Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            int CID = Convert.ToInt32(lueSUP.EditValue);

            wrPurchases.Server2Client sc  = new wrPurchases.Server2Client();
            wrPurchases.wsPurchases   pp  = new wrPurchases.wsPurchases();
            rptSupplierPurchase       rpt = new rptSupplierPurchase();

            if (checkEdit1.Checked)
            {
                sc             = pp.PurchaseFromSupplierByID(CID);
                rpt.DataSource = sc.dataTable;
                rpt.lbTTL.Text = "Product(s) purchased from Supplier";
            }
            else
            {
                sc             = pp.PurchaseFromSupplierByDates(CID, dtFrm.DateTime, dtTos.DateTime);
                rpt.DataSource = sc.dataTable;
                rpt.lbTTL.Text = "Product(s) purchased from Supplier between " + dtFrm.DateTime.ToShortDateString() + " and " + dtTos.DateTime.ToShortDateString();
            }

            GroupField grp = new GroupField("PurchaseDate");

            rpt.GroupHeader1.GroupFields.Add(grp);

            wrSuppliers.wsSuppliers sup = new wrSuppliers.wsSuppliers();
            wrSuppliers.Supplier    s   = new wrSuppliers.Supplier();
            s = sup.getSupplier(CID);

            rpt.lbSNM.Text = s.SupplierName;
            rpt.lbADR.Text = s.Address;
            rpt.lbPHN.Text = s.Phone;
            rpt.lbSDT.DataBindings.Add("Text", null, "PurchaseDate", "{0:dd-MM-yyyy}");
            rpt.lbPNM.DataBindings.Add("Text", null, "ProductName");
            rpt.lbSNO.DataBindings.Add("Text", null, "BarCode");
            rpt.lbSVL.DataBindings.Add("Text", null, "BuyingValue", "{0:C2}");
            rpt.lbQTY.DataBindings.Add("Text", null, "TotalQuantity");
            rpt.lbAMT.DataBindings.Add("Text", null, "Amount", "{0:C2}");

            dv.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument(true);

            popSupplier.HidePopup();
        }
Beispiel #4
0
        public frmSuppliers(int id)
        {
            InitializeComponent();

            lbMSG.Text   = string.Empty;
            tmr.Interval = 1000;
            tmr.Tick    += new EventHandler(this.tmr_tick);

            sc  = new wrSuppliers.Server2Client();
            s   = new wrSuppliers.Supplier();
            sup = new wrSuppliers.wsSuppliers();

            s           = sup.getSupplier(id);
            _id         = id;
            txtCNM.Text = s.SupplierName;
            txtADR.Text = s.Address;
            txtPHN.Text = s.Phone;
            txtEML.Text = s.Email;
            //txtBAL.Text = cus.Balance.ToString();

            btnOK.Text = "&Update";
        }
Beispiel #5
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (btnOK.Text == "&Update")
     {
         if (dxvp.Validate())
         {
             sc             = new wrSuppliers.Server2Client();
             s              = new wrSuppliers.Supplier();
             sup            = new wrSuppliers.wsSuppliers();
             s.SupplierID   = _id;
             s.SupplierName = txtCNM.Text;
             s.Address      = txtADR.Text;
             s.Phone        = txtPHN.Text;
             s.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc = sup.updateSupplier(s);
             if (sc.Message == null)
             {
                 lbMSG.Text = "Supplier details updated!";
                 Close();
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
         }
     }
     else if (btnOK.Text == "&Save")
     {
         if (dxvp.Validate())
         {
             sc             = new wrSuppliers.Server2Client();
             s              = new wrSuppliers.Supplier();
             sup            = new wrSuppliers.wsSuppliers();
             s.SupplierName = txtCNM.Text;
             s.Address      = txtADR.Text;
             s.Phone        = txtPHN.Text;
             s.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc = sup.addSupplier(s);
             if (sc.Message == null)
             {
                 lbMSG.Text = "New Supplier added!";
                 reset();
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
             tmr.Enabled = true;
             tmr.Start();
         }
     }
     else
     {
         if (dxvp.Validate())
         {
             sc             = new wrSuppliers.Server2Client();
             s              = new wrSuppliers.Supplier();
             sup            = new wrSuppliers.wsSuppliers();
             s.SupplierName = txtCNM.Text;
             s.Address      = txtADR.Text;
             s.Phone        = txtPHN.Text;
             s.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc  = sup.addSupplier(s);
             _id = sc.Count;
             if (sc.Message == null)
             {
                 sc  = new wrSuppliers.Server2Client();
                 sup = new wrSuppliers.wsSuppliers();
                 //sc = sup.getMaxID();
                 DialogResult = DialogResult.OK;
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
         }
     }
 }