public void Show(int _RecId) { RecId = _RecId; if (_FormOpenType == FormOpenType.New) { __cTransaction = new CTransactionsDTO(); __cTransaction.CurCreatedDate = DateTime.Now; br_Fatura.Enabled = false; br_Irsaliye.Enabled = false; br_Siparis.Enabled = false; } if (_FormOpenType == FormOpenType.Edit) { __cTransaction = _repository.Run <CurrentTransactionsService, CTransactionsDTO>(x => x.GetCurrentTransaction(_RecId)); } bs_CTrans.DataSource = __cTransaction; do_CurrentGroupDefinitions(); do_LookSevkBilgileri(); MspTool.Get_Layout(this); this.ShowDialog(); }
public void do_Edit() { if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.CariList, AppMain.CompanyRecId)) { return; } CTransactionsDTO Orow = (CTransactionsDTO)gcv_CurTrans.GetFocusedRow(); if (Orow != null) { frmCariEdit frm = new frmCariEdit(); frm._FormOpenType = Msp.Infrastructure.FormOpenType.Edit; frm.Show(Orow.CurID); } }
private void btnRemAccount_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.CariList, AppMain.CompanyRecId)) { return; } CTransactionsDTO oRow = (CTransactionsDTO)gcv_CurTrans.GetFocusedRow(); if (oRow != null) { if (get_Question("Kayıt Silinecektir. Onaylıyor musunuz?")) { var result = _repository.Run <CurrentTransactionsService, ActionResponse <CTransactionsDTO> >(x => x.DeleteCurrentCustomer(oRow.CurID)); do_refresh(); } } }
private void bbi_Print_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { InvoiceOwnerDTO oRow = (InvoiceOwnerDTO)gcv_Invoice.GetFocusedRow(); if (oRow != null) { var trans = _repository.Run <InvoiceService, List <InvoiceTransDTO> >(x => x.Get_Edit_List_Trans(oRow.RecId)); CTransactionsDTO cTransactions = _currentTransactionsList.FirstOrDefault(x => x.CurID == oRow.CariRecId); List <ReportInvoiceTransDTO> reportTrans = new List <ReportInvoiceTransDTO>(); foreach (var item in trans) { reportTrans.Add(new ReportInvoiceTransDTO { ProductName = AppMain.Products.FirstOrDefault(x => x.PID == item.ProductId).PName, Tutar = item.Tutar, Unit = item.Quentity + " " + _list_UnitsDTO.FirstOrDefault(x => x.UID == item.UnitID.GetValueOrDefault()).UName, PTax = item.KDVPrice }); } ReportInvoice reportInvoice = new ReportInvoice { CustomerName = cTransactions.CurAccountName, CustomerAddress = cTransactions.CurAdress, CustomerCity = cTransactions.CurCity, CustomerCountry = cTransactions.CurCountryName, FaturaNo = oRow.FicheDocumentNo, FichDate = oRow.FicDate.GetValueOrDefault(), InvoiceType = oRow.InvoiceType.GetValueOrDefault(), trans = reportTrans }; frmPrint frm = new frmPrint(); frm.PrintInvoiceReport(oRow, reportTrans, cTransactions, reportInvoice); frm.ShowDialog(); } }
public ActionResponse <CTransactionsDTO> SaveCurrrentCustomer(CTransactionsDTO model) { ActionResponse <CTransactionsDTO> response = new ActionResponse <CTransactionsDTO>() { Response = model, ResponseType = ResponseType.Ok }; using (MspDbContext _db = new MspDbContext()) { try { if (response.Response.CurID == 0) { _db.CurrentTransactions.Add(base.Map <CTransactionsDTO, CTransactions>(model)); _db.SaveChanges(); } else { var entity = _db.CurrentTransactions.FirstOrDefault(x => x.CurID == response.Response.CurID); if (entity != null) { _db.Entry(entity).CurrentValues.SetValues(model); _db.Entry(entity).State = System.Data.Entity.EntityState.Modified; } } _db.SaveChanges(); } catch (Exception e) { response.Message = e.ToString(); response.ResponseType = ResponseType.Error; } } return(response); }
public void InitData(InvoiceOwnerDTO saleOwners, List <ReportInvoiceTransDTO> List_InvoiceTrans, CTransactionsDTO cTransactions, ReportInvoice reports) { objectDataSource1.DataSource = saleOwners; objectDataSource2.DataSource = List_InvoiceTrans; objectDataSource3.DataSource = cTransactions; objectDataSource4.DataSource = reports; }
public void PrintInvoiceReport(InvoiceOwnerDTO InvoiceOwner, List <ReportInvoiceTransDTO> reportInvoiceTrans, CTransactionsDTO cTransactions, ReportInvoice reports) { InvoiceReport_Sablon1 report = new InvoiceReport_Sablon1(); foreach (DevExpress.XtraReports.Parameters.Parameter p in report.Parameters) { p.Visible = false; } report.InitData(InvoiceOwner, reportInvoiceTrans, cTransactions, reports); documentViewer1.DocumentSource = report; report.CreateDocument(); }