Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data;
- using System.Data.OleDb;
- public partial class _Default : System.Web.UI.Page
- {
- private ServiceReference1.ServiceSoapClient s = new ServiceReference1.ServiceSoapClient();
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void btnSubmit_Click(object sender, EventArgs e)
- {
- ServiceReference1.Users c = new ServiceReference1.Users();
- c.Username = txtUsername.Text;
- c.Password = txtPassword.Text;
- DataTable dt = s.LogIn(c);
- if (dt.Rows.Count == 0)
- {
- lblLogin.Text = "The user does not exist";
- }
- else
- {
- Session["Users"] = dt;
- lblLogin.Text = "Welcome!";
- int l = int.Parse(dt.Rows[0][7].ToString());
- if (l == 1)
- {
- Response.Redirect("AdminArea.aspx");
- }
- if (l == 0)
- {
- Response.Redirect("ClientArea.aspx");
- }
- if (l == 2)
- {
- Response.Redirect("TechnicianArea.aspx");
- }
- if (l == 3)
- {
- Response.Redirect("DriverArea.aspx");
- }
- else
- Response.Redirect("Fail.aspx");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement