protected void Button1_Click(object sender, EventArgs e)
        {
            string   cn      = cname.Text;
            string   g       = ddlgender.SelectedItem.Value;
            DateTime d       = Convert.ToDateTime(dob.Text);
            long     contact = Convert.ToInt64(cno.Text);
            string   c       = city.Text;

            Customerbo      C  = new Customerbo(cn, g, d, contact, c);
            CustomerMethods CM = new CustomerMethods();

            int cid = CM.AddCustomer(C);

            if (cid > 0)
            {
                Label1.Text = "" + cid;
            }

            else
            {
                Response.Write("<script>alert('Error')</script>");
            }
        }
        public void AddCustomerTest()
        {
            var result = CustomerMethods.AddCustomer(AccessToken.AccessToken.CustomerAddRemoveAccessToken,
                                                     new AddCustomerModel()
            {
                Name = "Bob"
            });

            if (result.Result == ResultType.Error)
            {
                Assert.Fail();
            }

            var result2 = CustomerMethods.RemoveCustomer(AccessToken.AccessToken.CustomerAddRemoveAccessToken,
                                                         new RemoveCustomerModel()
            {
                CustomerId = result.CustomerId
            });

            if (result2.Result == ResultType.Error)
            {
                Assert.Fail();
            }
        }
Beispiel #3
0
 public void AddCustomer(Customer newCust)
 {
     customerMethods.AddCustomer(newCust);
 }