public JsonResult ChangePassword(ChangePassword objChangePass) { if (objChangePass.hdnEmail != null) { string email = EncryptDecrypt.Decrypt(objChangePass.hdnEmail); List<cEmpLogin> aobjLoginEmp = cEmpLogin.Find(" sEmailID = " + email); if (aobjLoginEmp.Count > 0) { aobjLoginEmp[0].sPassword = objChangePass.NewPassword; aobjLoginEmp[0].Save(); return Json("1"); } else { return Json("3"); } } else { if (objChangePass.CurrentPassword != null && objChangePass.CurrentPassword != "") { int loginID = Convert.ToInt32(HttpContext.User.Identity.Name); cEmpLogin objLoginEmp = cEmpLogin.Get_ID(loginID); objLoginEmp.sPassword = objChangePass.NewPassword; objLoginEmp.Save(); return Json("2"); } else { return Json("3"); } } }
public ActionResult ChangePassword(string Email) { ChangePassword omb = new ChangePassword(); if (Email != null) { omb.hdnEmail = Email; } return View(omb); }