Exemplo n.º 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            customers = new VO.CustomersVO();
            DialogResult dr = MessageBox.Show("Do you wish to Continue Updating?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                Activity = true;
                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.Custcode    = txtBoxCustomerCode.Text;
                Company = txtBoxCompany.Text;
                First   = txtBoxFirst.Text;
                Middle  = txtBoxMiddle.Text;
                Last    = txtBoxLast.Text;
                customers.UpdateCustomers();
                this.Close();
            }
        }
Exemplo n.º 2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            customers = new VO.CustomersVO();
            DialogResult dr = MessageBox.Show("Do you wish to Continue Updating?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            try
            {
                if (dr == System.Windows.Forms.DialogResult.Yes)
                {
                    Activity = true;
                    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;
                    }
                    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 (cBoxSuspended.Checked == true)
                    {
                        customers.Is_suspended = 1;
                    }
                    else
                    {
                        customers.Is_suspended = 0;
                    }
                    if (cBoxSummary.Checked == true)
                    {
                        customers.Has_summary = 1;
                    }
                    else
                    {
                        customers.Has_summary = 0;
                    }
                    if (txtBoxIR.Text != "")
                    {
                        customers.Interest_rate = Convert.ToDouble(txtBoxIR.Text);
                    }
                    else
                    {
                        customers.Interest_rate = 0;
                    }
                    customers.Due_date = dateTimePicker1.Text;
                    customers.Custcode = txtBoxCustomerCode.Text;
                    Company            = txtBoxCompany.Text;
                    First  = txtBoxFirst.Text;
                    Middle = txtBoxMiddle.Text;
                    Last   = txtBoxLast.Text;
                    customers.UpdateCustomers();
                    this.Close();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Check your Input and Try Again!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }