protected void btnSubmit_Click(object sender, EventArgs e) { Customer customer = new Customer(); customer.Action = InvokeOperation.Type.IN; string agentID = txtAgentID.Text; if (agentID != "") customer.AgentID = agentID; else return; string sponsorID = txtSopnsorID.Text; if (sponsorID != "") customer.SponsorID = sponsorID; else return; customer.CustomerName = txtFullName.Text; customer.Country = ddlCountry.SelectedItem.Text; customer.Phone = txtMobileNo.Text; customer.Email = txtEmail.Text; customer.ActivityStatus = "true"; customer.DOB = DateTime.Now; customer.FatherName = ""; customer.IsEmailEnabled = true; customer.IsWebEnabled = true; customer.IsSMSEnabled = true; customer.MailingAddress = ""; customer.MotherName = ""; customer.NationalID = ""; customer.Notes = ""; customer.PermanentAddress = ""; customer.RegistrationDate = DateTime.Now; customer.Sex = ""; customer.Zip = ""; if (txtUserID.Text != "") customer.CustomerID = txtUserID.Text; else return; CustomerSecret secret = new CustomerSecret(); secret.Action = InvokeOperation.Type.IN; if (txtUserID.Text != "") secret.CustomerID = txtUserID.Text; if (txtPassword.Text != "") secret.Password = txtPassword.Text; try { new ProcessManager(customer).invoke(); } catch { } try { new ProcessManager(secret).invoke(); ; } catch { } Response.Redirect("Home.aspx"); }
protected void btnLogin_Click(object sender, EventArgs e) { CustomerSecret secret = new CustomerSecret(); secret.Action = InvokeOperation.Type.SE; secret.CustomerID = userNameTextBox.Text.Trim(); secret.Password = passwordTextBox.Text.Trim(); IList<CustomerSecret> listofSecret; listofSecret = new ProcessManager(secret).GetList<CustomerSecret>(); if (listofSecret[0].CustomerID == userNameTextBox.Text.Trim() && listofSecret[0].Password == passwordTextBox.Text.Trim()) { Session["UserName"] = userNameTextBox.Text.Trim(); Session["Password"] = passwordTextBox.Text.Trim(); Response.Redirect("~/Default.aspx"); } else { Response.Redirect("~/Home.aspx"); } }