コード例 #1
0
 private void btnValidate_Click(object sender, EventArgs e)
 {
     setCustomer();
     try
     {
         _cust.Validate();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
 private void btnValidate_Click(object sender, EventArgs e)
 {
     try
     {
         SetCustomer();
         cust.Validate();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
コード例 #3
0
 private void btnValidate_Click(object sender, EventArgs e)
 {
     try
     {
         if (cust != null)
         {
             cust.CustomerName = txtCustomerName.Text;
             cust.PhoneNumber  = txtPhoneNumber.Text;
             string billingAmount = txtBillingAmount.Text;
             cust.BillAmount = string.IsNullOrEmpty(billingAmount) ? 0 : Convert.ToDecimal(billingAmount);
             if (validateDate(txtBillingDate.Text))
             {
                 cust.BillDate = string.IsNullOrEmpty(txtBillingDate.Text) ? DateTime.Now : Convert.ToDateTime(txtBillingDate.Text);
             }
             else
             {
                 MessageBox.Show("Please enter valid date");
             }
             cust.Address = txtAddress.Text;
             cust.Validate();
         }
         else
         {
             MessageBox.Show("Please select customer type first");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
コード例 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         SetCustomer();
         _customer.Validate();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #5
0
 private void btnValidate_Click(object sender, EventArgs e)
 {
     try
     {
         SetProperties();
         cust.Validate();
     }
     catch (Exception ex)
     {
         tbCheckReq.Text = ex.Message.ToString();
     }
 }
コード例 #6
0
 void ValidationClick(object sender, EventArgs e)
 {
     try {
         customer.Address      = Addresstxt.Text;
         customer.BillAmount   = Convert.ToDecimal(BillAmounttxt.Text);
         customer.BillDate     = Convert.ToDateTime(BillDatetxt.Text);
         customer.Customername = CustomerNametxt.Text;
         customer.phoneNumber  = PhoneNumbertxt.Text;
         customer.Validate();
     } catch (Exception exception) {
         MessageBox.Show(exception.Message);
     }
 }
コード例 #7
0
ファイル: Test.cs プロジェクト: pasarkode/MangoApps
        static void MainTestValidationForCustomerPKP(string[] args)
        {
            CustomerService srvc = new CustomerService("Customer");
            CustomerBase    data = null;

            try
            {
                data = srvc.Instance("PKP");
                data.CustomerName = "Nurul Hadi";
                data.Gender       = "Laki laki";
                data.Address      = "jl Raya pamayahan, Indramayu";
                data.PKPStatus    = "PKP";
                //data.Tempo = 40; Temp Can't more than 30 in PKP
                data.Tempo = 30;
                data.Validate();
                Console.WriteLine("Success validate");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }
コード例 #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     cust.Validate();
 }
コード例 #9
0
 public void Validate()
 {
     SetCustomer();
     cust.Validate();
 }
コード例 #10
0
 public void Save(CustomerBase baseObj)
 {
     baseObj.Validate();
     _repo.Save(baseObj);
 }