예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            customers = new VO.CustomersVO();
            DialogResult dr = MessageBox.Show("Do you wish to Continue?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                customers.Custcode    = txtBoxCustomerCode.Text;
                customers.Companyname = txtBoxCompany.Text;
                customers.Firstname   = txtBoxFirst.Text;
                customers.Middlename  = txtBoxMiddle.Text;
                customers.Lastname    = txtBoxLast.Text;
                customers.Email       = txtBoxEmail.Text;
                customers.Phone_no    = txtBoxPhone.Text;
                customers.Address     = txtBoxAddress.Text;
                customers.City        = txtBoxCity.Text;
                customers.Province    = txtBoxProv.Text;
                customers.Zip_code    = txtBoxZip.Text;
                customers.AddCustomers();
                activity = true;
                clearBoxes();
            }
        }
예제 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            customers = new VO.CustomersVO();
            DialogResult dr = MessageBox.Show("Do you wish to Continue?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            try
            {
                if (dr == System.Windows.Forms.DialogResult.Yes)
                {
                    customers.Custcode    = txtBoxCustomerCode.Text;
                    customers.Companyname = txtBoxCompany.Text;
                    customers.Firstname   = txtBoxFirst.Text;
                    customers.Middlename  = txtBoxMiddle.Text;
                    customers.Lastname    = txtBoxLast.Text;
                    customers.Email       = txtBoxEmail.Text;
                    customers.Phone_no    = txtBoxPhone.Text;
                    customers.Address     = txtBoxAddress.Text;
                    customers.City        = txtBoxCity.Text;
                    customers.Province    = txtBoxProv.Text;
                    customers.Zip_code    = txtBoxZip.Text;
                    customers.Tin         = mskTIN.Text;
                    customers.Sss         = mskSSS.Text;
                    if (txtBoxCreditLimit.Text != "")
                    {
                        customers.Creditlimit = Convert.ToDouble(txtBoxCreditLimit.Text);
                    }
                    else
                    {
                        customers.Creditlimit = 0;
                    }
                    //1-30 31-60 61-90 91+
                    if (cBoxNetDays.Text == "1-30")
                    {
                        customers.Netdays = 30;
                    }
                    if (cBoxNetDays.Text == "31-60")
                    {
                        customers.Netdays = 60;
                    }
                    if (cBoxNetDays.Text == "61-90")
                    {
                        customers.Netdays = 90;
                    }
                    if (cBoxNetDays.Text == "91+")
                    {
                        customers.Netdays = 120;
                    }
                    if (txtBoxIR.Text != "")
                    {
                        customers.Interest_rate = Convert.ToDouble(txtBoxIR.Text);
                    }
                    else
                    {
                        customers.Interest_rate = 0;
                    }
                    customers.AddCustomers();
                    activity = true;
                    clearBoxes();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Check your Input and Try Again!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }