Beispiel #1
0
        public bool LoginCheck(string LogName, string pwd)
        {
            bool IsSucess = false;
            var  inputpwd = PwdModel.GetKeyPwd(pwd);
            var  data     = ConnectToData.InstConnectToData.SQL_ExecuteScalar($"select [pwd] From [ur_user] where [login_name]={LogName}", "data source=.;user id=sa;password=sa;initial catalog=SOAP");

            if (data.ToString() == inputpwd)
            {
                IsSucess = true;
            }
            return(IsSucess);
        }
        public ActionResult ChangePwd(PwdModel dt)
        {
            Clinic_automation_systemEntities db = new Clinic_automation_systemEntities();
            var getdata = db.MemberLogins.Where(m => m.MemberId == Convert.ToInt32(Session["MemberId"])).FirstOrDefault();

            if (ModelState.IsValid)
            {
                if (getdata.Password == dt.OldPassword)
                {
                    getdata.Password = dt.NewPassword;
                    ViewBag.text     = "Password Changed Successfully";
                }
                else
                {
                    ViewBag.text = "You entered a wrong current password";
                }
            }

            return(View());
        }