示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (dxValidationProvider1.Validate())
            {
                sc = new Server2Client();
                SupplierAccount ss = new SupplierAccount();

                string Remarks = txtRMKS.Text == "" ? "Debit Payment" : txtRMKS.Text;
                ss.SupplierID  = Convert.ToInt32(lueSNM.EditValue);
                ss.TransDate   = txtPDT.DateTime;
                ss.Description = Remarks;
                ss.Debit       = 0;
                ss.Credit      = Convert.ToDouble(txtAMNT.Text);
                ss.Balance     = Convert.ToDouble(txtNBAL.Text);

                sa = new SupplierAccounts();
                sc = sa.addTrans(ss);

                if (sc.Message == null)
                {
                    XtraMessageBox.Show("Payment done successfully!");
                    lueSNM.EditValue = null;
                    txtCBAL.Text     = "0";
                    txtAMNT.Text     = "0";
                    txtNBAL.Text     = "0";
                    txtRMKS.Text     = "";
                }
                else
                {
                    XtraMessageBox.Show(sc.Message);
                }
            }
        }
示例#2
0
        public frmSelectCustomer(int ID)
        {
            InitializeComponent();
            Server2Client sc  = new Server2Client();
            Customers     cus = new Customers();

            sc = cus.getCustomers();
            lueCNM.Properties.DataSource    = sc.dataTable;
            lueCNM.Properties.DisplayMember = "CustomerName";
            lueCNM.Properties.ValueMember   = "ID";
            checkEdit1_CheckedChanged(null, null);
            chkSelect.Enabled = false;
        }
示例#3
0
        public frmSelectSupplier()
        {
            InitializeComponent();

            Server2Client sc = new Server2Client();

            Suppliers sup = new Suppliers();

            sc = sup.getSuppliers();
            lueSNM.Properties.DataSource    = sc.dataTable;
            lueSNM.Properties.DisplayMember = "SupplierName";
            lueSNM.Properties.ValueMember   = "ID";

            chkSEL_CheckedChanged(null, null);
        }
示例#4
0
        public frmSelectCustomer()
        {
            InitializeComponent();

            Server2Client sc  = new Server2Client();
            Customers     cus = new Customers();

            sc = cus.getCustomers();
            lueCNM.Properties.DataSource    = sc.dataTable;
            lueCNM.Properties.DisplayMember = "CustomerName";
            lueCNM.Properties.ValueMember   = "ID";

            checkEdit1_CheckedChanged(null, null);
            dtFr.DateTime = DateTime.Now.Date;
            dtTo.DateTime = DateTime.Now.Date;
        }
示例#5
0
        public frmDebitPayment()
        {
            InitializeComponent();
            txtPDT.DateTime = DateTime.Now.Date;
            sc = new Server2Client();
            s  = new Suppliers();
            sc = s.getSuppliersFull();

            lueSNM.Properties.DataSource    = sc.dataTable;
            lueSNM.Properties.DisplayMember = "SupplierName";
            lueSNM.Properties.ValueMember   = "ID";

            txtCBAL.Text = "0";
            txtAMNT.Text = "0";
            txtNBAL.Text = "0";
        }
示例#6
0
        public frmCreditPayment()
        {
            InitializeComponent();

            txtPDT.DateTime = DateTime.Now.Date;
            sc  = new Server2Client();
            cus = new Customers();
            sc  = cus.getCustomers();

            lueCNM.Properties.DataSource    = sc.dataTable;
            lueCNM.Properties.DisplayMember = "CustomerName";
            lueCNM.Properties.ValueMember   = "ID";

            txtCBAL.Text = "0";
            txtAMNT.Text = "0";
            txtNBAL.Text = "0";
        }
示例#7
0
        private void lueSNM_EditValueChanged(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(lueSNM.EditValue);

            sc = new Server2Client();
            sa = new SupplierAccounts();
            sc = sa.getSupplierBalance(id);

            if (sc.Message != null)
            {
                txtCBAL.Text    = sc.Message;
                txtCBAL.Enabled = false;
            }
            else
            {
                txtCBAL.Text = sc.Value.ToString();
            }
        }
示例#8
0
        public frmDebitPayment(int SupplierID)
        {
            InitializeComponent();
            txtPDT.DateTime = DateTime.Now.Date;
            sc = new Server2Client();
            s  = new Suppliers();
            sa = new SupplierAccounts();
            sc = s.getSuppliers();

            lueSNM.Properties.DataSource    = sc.dataTable;
            lueSNM.Properties.DisplayMember = "SupplierName";
            lueSNM.Properties.ValueMember   = "ID";

            lueSNM.EditValue = SupplierID;
            sc = sa.getSupplierBalance(SupplierID);

            txtCBAL.Text = sc.Value.ToString();

            txtAMNT.Text = "0";
            txtNBAL.Text = "0";
        }
示例#9
0
        public frmCustomer(int ID)
        {
            InitializeComponent();
            lbMSG.Text   = string.Empty;
            tmr.Interval = 1000;
            tmr.Tick    += new EventHandler(this.tmr_tick);

            sc   = new Server2Client();
            cus  = new Customer();
            cust = new Customers();

            cus         = cust.getCustomer(ID);
            _id         = ID;
            txtCNM.Text = cus.CustomerName;
            txtADR.Text = cus.Address;
            txtPHN.Text = cus.Phone;
            txtEML.Text = cus.Email;
            //txtBAL.Text = cus.Balance.ToString();

            btnSave.Text = "&Update";
        }
示例#10
0
        public frmCreditPayment(int CustomerID)
        {
            InitializeComponent();

            txtPDT.DateTime = DateTime.Now.Date;
            sc  = new Server2Client();
            cus = new Customers();
            ca  = new CustomerAccounts();
            sc  = cus.getCustomers();

            lueCNM.Properties.DataSource    = sc.dataTable;
            lueCNM.Properties.DisplayMember = "CustomerName";
            lueCNM.Properties.ValueMember   = "ID";

            lueCNM.EditValue = CustomerID;
            sc = ca.getCustomerBalance(CustomerID);

            txtCBAL.Text = sc.Value.ToString();

            txtAMNT.Text = "0";
            txtNBAL.Text = "0";
        }
示例#11
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (btnSave.Text == "&Update")
     {
         if (dxVP.Validate())
         {
             sc               = new Server2Client();
             cus              = new Customer();
             cust             = new Customers();
             cus.CustomerID   = _id;
             cus.CustomerName = txtCNM.Text;
             cus.Address      = txtADR.Text;
             cus.Phone        = txtPHN.Text;
             cus.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc = cust.updateCustomer(cus);
             if (sc.Message == null)
             {
                 lbMSG.Text = "Customer details updated!";
                 Close();
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
         }
     }
     else if (btnSave.Text == "&Save")
     {
         if (dxVP.Validate())
         {
             sc               = new Server2Client();
             cus              = new Customer();
             cust             = new Customers();
             cus.CustomerName = txtCNM.Text;
             cus.Address      = txtADR.Text;
             cus.Phone        = txtPHN.Text;
             cus.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc = cust.addCustomer(cus);
             if (sc.Message == null)
             {
                 lbMSG.Text = "New Customer added!";
                 reset();
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
             tmr.Enabled = true;
             tmr.Start();
         }
     }
     else
     {
         if (dxVP.Validate())
         {
             sc               = new Server2Client();
             cus              = new Customer();
             cust             = new Customers();
             cus.CustomerName = txtCNM.Text;
             cus.Address      = txtADR.Text;
             cus.Phone        = txtPHN.Text;
             cus.Email        = txtEML.Text;
             //cus.Balance = Convert.ToInt32(txtBAL.Text);
             sc = cust.addCustomer(cus);
             if (sc.Message == null)
             {
                 sc   = new Server2Client();
                 cust = new Customers();
                 sc   = cust.getMaxID();
                 _id  = sc.Count;
                 Close();
             }
             else
             {
                 lbMSG.Text = sc.Message;
             }
         }
     }
 }