Exemplo n.º 1
0
 private void btnlogin_Click(object sender, EventArgs e)
 {
     //Main lf = new Main();
     //lf.Show();
     try
     {
         String Role = mc.Login(txtusername.Text, txtpassword.Text);
         if (Role == "Admin")
         {
             Dashboard frm = new Dashboard();
             frm.Show();
         }
         else if (Role == "User")
         {
             Dashboard frm = new Dashboard();
             frm.Show();
         }
         else
         {
             MessageBox.Show("Invalid user name or password");
             txtusername.Clear();
             txtpassword.Clear();
             txtusername.Focus();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Invalid user name or password");
         txtusername.Clear();
         txtpassword.Clear();
         txtusername.Focus();
         txtusername.BackColor = Color.Red;
         txtpassword.BackColor = Color.Red;
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        MemberClass ME = new MemberClass();

        if (ME.Login(txtemail.Text, txtpass.Text))
        {
            Utility.CreateCookies("Login", new string[] { "user", "Pass" }, new string[] { txtemail.Text, txtpass.Text }, !CheckBox1.Checked, Response);
            GO(txtemail.Text);
        }
        else
        {
            Label2.Text = "Email Address/Password 'Incorrect'";
        }
    }