Esempio n. 1
0
 protected void lbtnlogin_Click(object sender, EventArgs e)
 {
     try
     {
         logincls obj    = new logincls();
         bool     flag   = false;
         bool     status = false;
         flag   = obj.loginchk(txtuseridname.Text.Trim(), txtpassword.Text.Trim(), RadioButton1.SelectedValue.ToString());
         status = obj.loginchkstatus(txtuseridname.Text.Trim(), txtpassword.Text.Trim(), RadioButton1.SelectedValue.ToString());
         if (status == true)
         {
             Session["UserName"] = txtuseridname.Text;
             if (RadioButton1.SelectedValue == "A")
             {
                 Response.Redirect("~/Admin/userlist.aspx");
             }
             else
             {
                 Response.Redirect("~/Home.aspx");
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "popup",
                                                 "alert('Check your UserName Password or Group');", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "popup",
                                             "alert(" + ex + ");", true);
     }
 }
Esempio n. 2
0
        protected void lbtnlogin_Click(object sender, EventArgs e)
        {
            try
            {
                logincls obj = new logincls();
                bool flag = false;
                bool status = false;
                flag = obj.loginchk(txtuseridname.Text.Trim(), txtpassword.Text.Trim(), RadioButton1.SelectedValue.ToString());
                status = obj.loginchkstatus(txtuseridname.Text.Trim(), txtpassword.Text.Trim(), RadioButton1.SelectedValue.ToString());
                if (status == true)
                {
                    Session["UserName"] = txtuseridname.Text;
                    if (RadioButton1.SelectedValue == "A")
                    {
                        Response.Redirect("~/Admin/userlist.aspx");
                    }
                    else
                    {
                        Response.Redirect("~/Home.aspx");
                    }


                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "popup",
                          "alert('Check your UserName Password or Group');", true);

                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "popup",
              "alert(" + ex + ");", true);
            }
        }