Example #1
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (Phone.Equals(""))
     {
         MessageBox.Show("Please fill the phone");
     }
     else
     {
         string err = "";
         if (!vl.CheckPhone(Phone))
         {
             err += "Phone is a string has 10 number.\n";
         }
         if (err.Equals(""))
         {
             if (products.Count > 0)
             {
                 MCusP.AddCustomer();
                 orderID = MOP.AddOrder();
                 MDP.AddDetail();
                 MCP.UpdateQuantityProduct();
                 MessageBox.Show("OK");
                 LoadCar();
                 products.Clear();
                 LoadCart();
             }
             else
             {
                 MessageBox.Show("No product added");
             }
         }
         else
         {
             MessageBox.Show(err);
         }
     }
 }