protected void Button1_Click(object sender, EventArgs e) { client = new ServiceReference2.AccountServiceClient(); Users userinfo = new Users(); userinfo.Email = TextBox1.Text; userinfo.Password = TextBox2.Text; if (TextBox1.Text == "admin" && TextBox2.Text == "admin") { Response.Redirect("Employee.aspx"); } else { List <string> msg = client.LoginUserDetails(userinfo).ToList(); //Label3.Text = "Employee Name = " + msg.ElementAt(0) + " Employee Id = " + msg.ElementAt(1); if (msg.Count != 0) { Session["Email"] = msg.ElementAt(0); Response.Redirect("Home.aspx"); } else { Label3.Text = "Enter the Valid Credentials!!!"; Thread.Sleep(5000); Response.Redirect("login.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { ServiceReference2.AccountServiceClient client; client = new ServiceReference2.AccountServiceClient(); Users us = new Users(); string email = Session["Email"].ToString(); us = client.getUserbyID(email); Label1.Text = us.FirstName; Label2.Text = us.LastName; Label3.Text = us.Email; Label4.Text = us.Address; Label5.Text = us.Password; Label6.Text = (us.Balance).ToString(); Label7.Text = us.Contact; }
protected void Button1_Click(object sender, EventArgs e) { client = new ServiceReference2.AccountServiceClient(); Users cs = new Users(); cs.FirstName = fn.Text; cs.LastName = ln.Text; cs.Email = email.Text; cs.Address = addr.Text; cs.Balance = int.Parse(bal.Text); cs.Contact = cont.Text; cs.Password = pswd.Text; string r = client.Insert(cs); Response.Redirect("login.aspx"); }