protected void Button1_Click(object sender, EventArgs e) { ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1"); ServiceReference2.User u = new ServiceReference2.User(); u.UserName = TextBox1.Text; u.Email = TextBox2.Text; u.Password = TextBox3.Text; string cpass = TextBox4.Text; u.Contact = TextBox5.Text; u.Role = DropDownList1.SelectedValue; if (!cpass.Equals(u.Password)) { Label1.Text = "password and confirm password does not match"; } else { string st = s.AddUser(u); if (st.Equals("Username already exist")) { Label1.Text = "Username already exists"; // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Username already exist')", true); // Response.Write("<script>alert('Username already exist')</script>"); } else { Response.Redirect("Login.aspx"); } } }
protected void Button1_Click(object sender, EventArgs e) { ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1"); ServiceReference2.User u = new ServiceReference2.User(); u.UserName = TextBox1.Text; u.Email = TextBox2.Text; u.Password = TextBox3.Text; u.Contact = TextBox5.Text; u.Role = TextBox6.Text; string st = s.AddUser(u); Response.Redirect("Login.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { ServiceReference2.Service1Client c = new ServiceReference2.Service1Client("BasicHttpBinding_IService1"); ServiceReference2.User user = new ServiceReference2.User(); user.Contact = Contact.Text; user.Email = Email.Text; user.Password = Session["pass"].ToString(); user.Role = Role.Text; user.UserName = Username.Text; Console.WriteLine(user.Email); string ret = c.UpdateUser(user); if (ret == "updated") { Response.Redirect("UserHome.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1"); ServiceReference2.User u = new ServiceReference2.User(); u.UserName = TextBox1.Text; u.Password = TextBox2.Text; u.Role = TextBox3.Text; string st = s.Login(u); if (st.Equals("login")) { Session["username"] = u.UserName.ToString(); Response.Redirect("company.aspx"); } else { Response.Redirect("Login.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1"); ServiceReference2.User u = new ServiceReference2.User(); u.UserName = TextBox1.Text; u.Password = TextBox2.Text; u.Role = DropDownList1.SelectedValue; Session["username"] = u.UserName; Session["role"] = u.Role; if (u.UserName == "admin" && u.Password == "admin123") { Response.Redirect("AdminHome.aspx"); } string st = s.Login(u); if (st.Equals("login") && u.Role.Equals("user")) { Session["username"] = u.UserName; Session["role"] = u.Role; Response.Redirect("UserHome.aspx"); } else if (st.Equals("login") && u.Role.Equals("company")) { Session["username"] = u.UserName; Session["role"] = u.Role; Response.Redirect("company.aspx"); } else { label1.Text = "Login details invalid"; // Response.Redirect("Login.aspx"); } }