private void bDebitPayment_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { frmSelectSupplier frm = new frmSelectSupplier(); if (frm.ShowDialog() == DialogResult.OK) { wrSuppliers.Server2Client sc = new wrSuppliers.Server2Client(); wrSuppliers.wsSuppliers sup = new wrSuppliers.wsSuppliers(); wrSuppliers.Supplier s = new wrSuppliers.Supplier(); double bal = 0; s = sup.getSupplier(frm.SupplierID); rptDebitPayment rpt = new rptDebitPayment(); XRSummary tdr = new XRSummary(); XRSummary tcr = new XRSummary(); rpt.lbSNM.Text = s.SupplierName; rpt.lbADR.Text = s.Address; rpt.lbPHN.Text = s.Phone; rpt.lbEML.Text = s.Email; if (!frm.DateSelected) { sc = sup.getSupplierBalanceByID(frm.SupplierID); bal = sc.Value; sc = sup.getTransactionDetails(frm.SupplierID); rpt.DataSource = sc.dataTable; } else { sc = sup.getSupplierBalanceByDates(frm.SupplierID, frm.DateFrom, frm.DateTo); bal = sc.Value; sc = sup.AccountStatement(frm.SupplierID, frm.DateFrom, frm.DateTo); rpt.DataSource = sc.dataTable; } rpt.lbTDT.DataBindings.Add("Text", null, "TransDate", "{0:dd-MM-yyyy}"); rpt.lbRMK.DataBindings.Add("Text", null, "Description"); rpt.lbTDR.DataBindings.Add("Text", null, "Debit", "{0:c}"); rpt.lbTCR.DataBindings.Add("Text", null, "Credit", "{0:c}"); rpt.lbBAL.DataBindings.Add("Text", null, "Balance", "{0:c}"); rpt.lblTDR.DataBindings.Add("Text", null, "Debit", "{0:C2}"); rpt.lblTCR.DataBindings.Add("Text", null, "Credit", "{0:C2}"); rpt.lblTBL.Text = bal.ToString("c2"); tdr.FormatString = "{0:C2}"; tcr.FormatString = "{0:C2}"; tdr.Running = SummaryRunning.Report; tcr.Running = SummaryRunning.Report; rpt.lblTCR.Summary = tdr; rpt.lblTDR.Summary = tcr; dv.PrintingSystem = rpt.PrintingSystem; rpt.CreateDocument(true); } }
private void lueSUP_EditValueChanged(object sender, EventArgs e) { int id = lueSUP.EditValue == null ? 0 : Convert.ToInt32(lueSUP.EditValue); wrSuppliers.Server2Client sc = new wrSuppliers.Server2Client(); wrSuppliers.wsSuppliers sa = new wrSuppliers.wsSuppliers(); wrSuppliers.Supplier sup = new wrSuppliers.Supplier(); //c = cus.getCustomer(id); sc = sa.getSupplierBalanceByID(id); SupplierBalance = sc.Value; }
private void lueSNM_EditValueChanged(object sender, EventArgs e) { int id = Convert.ToInt32(lueSNM.EditValue); sc = new wrSuppliers.Server2Client(); sup = new wrSuppliers.wsSuppliers(); sc = sup.getSupplierBalanceByID(id); if (sc.Message != null) { txtCBAL.Text = sc.Message; txtCBAL.Enabled = false; } else { txtCBAL.Text = sc.Value.ToString(); } }
public frmDebitPayment(int SupplierID) { InitializeComponent(); txtPDT.DateTime = DateTime.Now.Date; sc = new wrSuppliers.Server2Client(); sup = new wrSuppliers.wsSuppliers(); sc = sup.getSuppliers(); lueSNM.Properties.DataSource = sc.dataTable; lueSNM.Properties.DisplayMember = "SupplierName"; lueSNM.Properties.ValueMember = "ID"; lueSNM.EditValue = SupplierID; sc = sup.getSupplierBalanceByID(SupplierID); txtCBAL.Text = sc.Value.ToString(); txtAMNT.Text = "0"; txtNBAL.Text = "0"; }