Esempio n. 1
0
        public ActionResult Changepassword(UserChangepasswordVM poViewModel)
        {
            //ViewBag.AC_MENU_ID = valMENU.HAKAKSES_USERHQ_EDIT;

            var oData = oDS.getData(poViewModel.ID);

            poViewModel.USERNAME_DB = oData.USERNAME;
            poViewModel.PASSWORD_DB = oData.PASSWORD;

            oVAL = new User_Validation(poViewModel);
            oVAL.Validate_Changepassword();

            //Add Error if exists
            for (int i = 0; i < oVAL.aValidationMSG.Count; i++)
            {
                ModelState.AddModelError(oVAL.aValidationMSG[i].VAL_ERRID, oVAL.aValidationMSG[i].VAL_ERRMSG);
            } //End for (int i = 0; i < oVAL.aValidationMSG.Count; i++)

            if (ModelState.IsValid)
            {
                oCRUD.Changepassword(poViewModel);
                if (oCRUD.isERR)
                {
                    TempData["ERRMSG"] = oCRUD.ERRMSG;
                    return RedirectToAction("ErrorSYS", "Error");
                } //End if (!oCRUD.isERR) {

                TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE;
                return RedirectToAction("Index", "Home");
            }
            return View(poViewModel);
        }
Esempio n. 2
0
        public ActionResult Changepassword(int id)
        {
            if (id != hlpConfig.SessionInfo.getAppUserId())
            {
                return RedirectToAction("Error403", "Error");
            } //End if (id != hlpConfig.SessionInfo.getAppUserId())

            UserChangepasswordVM oData = new UserChangepasswordVM();
            oData.ID = id;
            return View(oData);
        }