protected void btnlogin_Click(object sender, EventArgs e) { string userid = txuserid.Text; string psw = txpsw.Text; string utype = usertype1.SelectedValue; if (utype.Equals("ADMIN")) { string status = ShopManagerRegistration.GetShopManagerLoginStatus(userid, psw); Session.Add("USERID", userid); if (status.Equals("valid user")) { Response.Redirect("managerportal.aspx"); } else { lbStatus.Text = status; } } if (utype.Equals("USER")) { string status = CustomerRegistration.GetCustomerLoginStatus(userid, psw); Session.Add("USERID", userid); if (status.Equals("valid user")) { Response.Redirect("ProductHome.aspx"); } else { lbStatus.Text = status; } } }
protected void abtnsignup_Click(object sender, EventArgs e) { string FN = txAFname.Text; string LN = txALname.Text; DateTime DOB; try { DOB = DateTime.Parse(txAdminDOB.Text); } catch (Exception ex) { DOB = DateTime.ParseExact(txAdminDOB.Text, "dd-MM-yyyy", null); } int age = Int32.Parse(txAge.Text.Substring(0, txAge.Text.IndexOf(" "))); string G = ""; if (arb1.Checked == true) { G = arb1.Text; } if (arb2.Checked == true) { G = arb2.Text; } string contact = txAcontact.Text; string admId = txAUserId.Text; string admPsw = txApw.Text; string confPsw = txAConfirm.Text; string status = ShopManagerRegistration.RegisterShopManager(FN, LN, DOB, age, G, contact, admId, admPsw, confPsw); lbStatus.Text = status; if (status.Equals("ShopManager Details Registered Successfully!")) { Response.Redirect("firstpage.aspx"); } }