protected void addCustomerBtn_Click(object sender, EventArgs e) { ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(); ServiceReference1.customer customer = new ServiceReference1.customer(); addCustomerDetails(customer); sc.addLogin(customer.Email, "123456", "Customer"); int rows_affected = sc.addCustomer(customer); if (rows_affected == 0) { Label2.Text = Resources.Resource.customerAddingError; } else { Label2.Text = Resources.Resource.customerAdded; } }
protected void addCustomerBtn_Click(object sender, EventArgs e) { ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(); ServiceReference1.customer customer = new ServiceReference1.customer(); addCustomerDetails(customer); sc.addLogin(customer.Email, "123456", "Customer"); int rows_affected = sc.addCustomer(customer); if (rows_affected == 0) { Label2.Text = System.Configuration.ConfigurationManager.AppSettings["customerAddingError"]; } else { Label2.Text = System.Configuration.ConfigurationManager.AppSettings["customerAdded"]; } }
//string oldEmailId; // REPRESENTS THE OLD EMAIL ID, USED TO UPDATE CUSTOMER LOGIN DETAILS protected void editCustomerBtn_Click(object sender, EventArgs e) { ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(); ServiceReference1.customer customer = new ServiceReference1.customer(); customer = addCustomerDetails(customer); //fillData(); /*if (customer.Email != oldEmailId) *///oldEmailId is global variable //sc.updateUserId(customer.Email, oldEmailId); int rows_affected = sc.updateCustomer(customer); if (rows_affected == 0) { Label2.Text = "Error while updating customer"; } else { Label2.Text = "Customer Updated!"; } }
protected void addCustomerDetails(ServiceReference1.customer customer) { //customer.CustomerID = int.Parse(custId.Text); customer.CustomerName = custName1.Text; if (male.Checked) { customer.Gender = 'M'; } else { customer.Gender = 'F'; } customer.Dob = dob.SelectedDate.ToShortDateString(); customer.Address = address.Text; customer.State = state.SelectedValue; customer.City = city.SelectedValue; customer.Pincode = pinCode.Text; customer.PhoneNo = phoneNumber.Text; customer.Email = email2.Text; customer.CreatedDate = DateTime.Now.ToShortDateString(); customer.EditedDate = DateTime.Now.ToShortDateString(); customer.UserID = email2.Text; }
protected void addCustomerDetails(ServiceReference1.customer customer) { //customer.CustomerID = int.Parse(custId.Text); customer.CustomerName = custName1.Text; if (male.Checked) { customer.Gender = 'M'; } else { customer.Gender = 'F'; } customer.Dob = dob.Text; //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('text Selected Date: " + dob.Text + "');", true); customer.Address = address.Text; customer.State = state.SelectedValue; customer.City = city.SelectedValue; customer.Pincode = pinCode.Text; customer.PhoneNo = phoneNumber.Text; customer.Email = email2.Text; customer.CreatedDate = DateTime.Now.ToShortDateString(); customer.EditedDate = DateTime.Now.ToShortDateString(); customer.UserID = email2.Text; }