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 Edit(UserdetailHQVM poViewModel, HttpPostedFileBase FileUSER_IMG)
        {
            ViewBag.AC_MENU_ID = valMENU.HAKAKSES_USERHQ_EDIT;

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

            //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)
            {
                if (poViewModel.PASSWORD != null) { poViewModel.PASSWORD = hlpObf.randomEncrypt(poViewModel.PASSWORD); }
                oCRUD.Update(poViewModel, FileUSER_IMG);
                if (oCRUD.isERR)
                {
                    TempData["ERRMSG"] = oCRUD.ERRMSG;
                    return RedirectToAction("ErrorSYS", "Error");
                } //End if (!oCRUD.isERR) {

                TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE;
                return RedirectToAction("Details", new { id = oCRUD.ID });
            }
            return View(poViewModel);
        }
Esempio n. 3
0
        public ActionResult Create(UserdetailVM poViewModel, HttpPostedFileBase FileUSER_IMG)
        {
            //ViewBag.AC_MENU_ID = valMENU.HAKAKSES_USERHQ_CREATE;

            ViewBag.CRUD_type = hlpFlags_CRUDOption.CREATE;

            //USERNAME=RES_CD
            //poViewModel.USERNAME = poViewModel.RES_CD;
            oVAL = new User_Validation(poViewModel);
            oVAL.Validate_Create();
            //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)
            {
                if (poViewModel.PASSWORD != null) { poViewModel.PASSWORD = hlpObf.randomEncrypt(poViewModel.PASSWORD); }
                oCRUD.Create(poViewModel, FileUSER_IMG);
                oCRUD.Commit();
                if (oCRUD.isERR) {
                    TempData["ERRMSG"] = oCRUD.ERRMSG;
                    return RedirectToAction("ErrorSYS", "Error");
                } //End if (!oCRUD.isERR) {

                TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE;
                return RedirectToAction("Details", new { id = oCRUD.ID });
            } //End if (ModelState.IsValid)

            prepareLookup();
            return View(poViewModel);
        }
Esempio n. 4
0
        public ActionResult Edit(User_DetailCPARVM poViewModel, HttpPostedFileBase Fileimage)
        {
            oVAL = new User_Validation(poViewModel, Fileimage);
            oVAL.Validate_UserUpdateCPAR();

            //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.UpdateCPAR(poViewModel, Fileimage);
                if (oCRUD.RUID != null) { return RedirectToAction("Details", new { id = oCRUD.RUID }); }
                else { return RedirectToAction("Index"); }
            }
            return View(poViewModel);
        }
Esempio n. 5
0
        public ActionResult Create(User_DetailVM poViewModel)
        {
            
            oVAL = new User_Validation(poViewModel);
            oVAL.Validate_UserCreate();

            //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.Create(poViewModel);
                return RedirectToAction("Index");
            } //End if (ModelState.IsValid)

            return View(poViewModel);
        }
Esempio n. 6
0
        public ActionResult Create(User_DetailCPARVM poViewModel, HttpPostedFileBase Fileimage)
        {
            ViewBag.CRUD_type = hlpFlags_CRUDOption.CREATE;
            oVAL = new User_Validation(poViewModel, Fileimage);
            oVAL.Validate_UserCreateCPAR();

            //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.CreateCPAR(poViewModel, Fileimage);
                if (oCRUD.RUID != null) { return RedirectToAction("Role", new { id = oCRUD.RUID }); }
                else { return RedirectToAction("Index"); }
            } //End if (ModelState.IsValid)

            return View(poViewModel);
        }