Ejemplo n.º 1
0
        private void txtCustomerName_ButtonCustomClick(object sender, EventArgs e)
        {
            frmSelectCustomer frmSelectCustomer = new frmSelectCustomer(false, "colCompanyID");

            frmSelectCustomer.BringToFront();
            frmSelectCustomer.StartPosition = FormStartPosition.CenterScreen;
            DialogResult rst = frmSelectCustomer.ShowDialog();

            if (rst == DialogResult.OK)
            {
                List <CRM_CompanyResult> rstList = frmSelectCustomer.GetSelectList <CRM_CompanyResult>();
                if (rstList != null && rstList.Count > 0)
                {
                    txtCustomerID.Text            = rstList[0].CompanyID.ToStringHasNull();
                    txtCustomerName.Text          = rstList[0].CompanyName.ToStringHasNull();
                    txtAddress.Text               = rstList[0].Address;
                    txtContact.Text               = rstList[0].ContactName;
                    txtTelephone.Text             = rstList[0].Telephone;
                    txtEmail.Text                 = rstList[0].Email;
                    txtFax.Text                   = rstList[0].Fax;
                    cboClearingForm.SelectedValue = rstList[0].ClearingForm;
                    txtClearFormDay.Text          = rstList[0].ClearFormDay.ToStringHasNull();
                    txtDeliveryAddress.Text       = rstList[0].DeliveryAddress;
                    //txtReceiveContact.Text=rstList[0]
                    //txtRecComName.Text=rstList[0]
                }
            }
        }
Ejemplo n.º 2
0
        private void bCreditPayment_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmSelectCustomer frm = new frmSelectCustomer();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                wrCustomers.Server2Client sc  = new wrCustomers.Server2Client();
                wrCustomers.wsCustomers   cus = new wrCustomers.wsCustomers();
                wrCustomers.Customer      c   = new wrCustomers.Customer();

                double bal = 0;
                c = cus.getCustomer(frm.CustomerID);
                rptCreditPayment rpt = new rptCreditPayment();

                XRSummary tdr = new XRSummary();
                XRSummary tcr = new XRSummary();

                rpt.lbCNM.Text = c.CustomerName;
                rpt.lbADR.Text = c.Address;
                rpt.lbPHN.Text = c.Phone;
                rpt.lbEML.Text = c.Email;

                if (!frm.DateSelected)
                {
                    sc             = cus.getCustomerBalanceByID(frm.CustomerID);
                    bal            = sc.Value;
                    sc             = cus.getTransactionDetails(frm.CustomerID);
                    rpt.DataSource = sc.dataTable;
                }
                else
                {
                    sc  = cus.getCustomerBalanceByDates(frm.CustomerID, frm.DateFrom, frm.DateTo);
                    bal = sc.Value;
                    //DataTable dt = cus.AccountStatement(frm.CustomerID, frm.DateFrom, frm.DateTo).dataTable;
                    sc             = cus.AccountStatement(frm.CustomerID, 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);
            }
        }
Ejemplo n.º 3
0
 private void btnSearchCust_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new frmSelectCustomer();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             SetCustomer(frm.Customer.Guid);
         }
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }
Ejemplo n.º 4
0
 private void btnSearchOwner_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new frmSelectCustomer();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             cls.Payer    = frm.Customer.Guid;
             txtName.Text = frm.Customer.Name;
         }
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }
Ejemplo n.º 5
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            frmSelectCustomer sel = new frmSelectCustomer(m_LoadAccount, txtCustomer.Text.Trim());

            if (sel.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                clsSubDAccount subd = sel.SelectedAccount;
                if (subd != null)
                {
                    txtCustomer.Text  = subd.Name;
                    txtMobileNum.Text = subd.MobileNum;
                    txtDisCount.Text  = subd.Discount.ToString();
                    lblBalance.Text   = "Account Balance: " + subd.Balance.ToString("n");
                    txtLoadAmount.Focus();
                }
            }
        }
Ejemplo n.º 6
0
        private void txtCustomerName_ButtonCustomClick(object sender, EventArgs e)
        {
            frmSelectCustomer frmSelectCustomer = new frmSelectCustomer(false, "colCompanyID");

            frmSelectCustomer.BringToFront();
            frmSelectCustomer.StartPosition = FormStartPosition.CenterScreen;
            DialogResult rst = frmSelectCustomer.ShowDialog();

            if (rst == DialogResult.OK)
            {
                List <CRM_CompanyResult> rstList = frmSelectCustomer.GetSelectList <CRM_CompanyResult>();
                if (rstList != null && rstList.Count > 0)
                {
                    txtCustomerID.Text   = rstList[0].CompanyID.ToStringHasNull();
                    txtCustomerName.Text = rstList[0].CompanyName.ToStringHasNull();
                }
            }
        }