public void changePassoword(object sender, EventArgs e)
        {
            SocioBoard.Domain.Admin admin = (SocioBoard.Domain.Admin)Session["AdminProfile"];
            AdminRepository adminrepo = new AdminRepository();

            if (txtPassword.Text != "" && txtConfirmPassword.Text != "")
            {
                if (txtPassword.Text == admin.Password)
                {

                    adminrepo.ChangePwd(txtConfirmPassword.Text, admin.UserName);
                    txtConfirmPassword.Text = string.Empty;
                    txtPassword.Text = string.Empty;
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Password changed successfully');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Wrong Password');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Password should not be blank');", true);
            }
        }
示例#2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {

            try
            {
                SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
                AdminRepository adminRepo = new AdminRepository();
                SocioBoard.Domain.Admin admin = adminRepo.GetUserInfo(txtUserName.Text, txtPassword.Text);
                if (admin != null)
                {
                    Session["AdminProfile"] = admin;
                    Response.Redirect("Dashboard.aspx");
                }

                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please enter correct Username and password!');", true);
                }

            }
            catch (Exception ex)
            {
            }

        }
示例#3
0
 public void changePassoword(object sender, EventArgs e)
 {
     if (txtPassword.Text != "" && txtConfirmPassword.Text != "")
     {
         if (txtPassword.Text == txtConfirmPassword.Text)
         {
             SocioBoard.Domain.Admin admin = (SocioBoard.Domain.Admin)Session["AdminProfile"];
             AdminRepository adminrepo = new AdminRepository();
             adminrepo.ChangePassword(txtPassword.Text, admin.Password,admin.UserName);
             txtConfirmPassword.Text = string.Empty;
             txtPassword.Text = string.Empty;
         }
     }
 }
示例#4
0
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
         AdminRepository adminRepo = new AdminRepository();
         SocioBoard.Domain.Admin admin = adminRepo.GetUserInfo(txtUserName.Text, txtPassword.Text);
         if (admin != null)
         {
             Session["AdminProfile"] = admin;
             Response.Redirect("Dashboard.aspx");
         }
     }
     catch (Exception ex)
     {
     }
 }