public ActionResult Edit(EmployeeuserVM poViewModel, HttpPostedFileBase FileEMPUSER_USERIMG) { this.oVAL = new Employeeuser_Validation(poViewModel, this.oDS); this.oVAL.Validate_Edit(); //Add Error if exists for (int i = 0; i < this.oVAL.aValidationMSG.Count; i++) { ModelState.AddModelError(this.oVAL.aValidationMSG[i].VAL_ERRID, this.oVAL.aValidationMSG[i].VAL_ERRMSG); } //End for (int i = 0; i < this.oVAL.aValidationMSG.Count; i++) if (ModelState.IsValid) { this.oCRUD.Update(poViewModel, FileEMPUSER_USERIMG); //this.oCRUD.Commit(); if (this.oCRUD.isERR) { TempData["ERRMSG"] = this.oCRUD.ERRMSG; return(RedirectToAction("ErrorSYS", "Error")); } //End if (!this.oCRUD.isERR) { TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE; return(RedirectToAction("Details", new { id = this.oCRUD.ID })); } prepareLookup(); return(View(poViewModel)); }
public ActionResult Delete(int?id = null) { //ViewBag.AC_MENU_ID = valMENU.MODULE_DELETE; ViewBag.CRUD_type = hlpFlags_CRUDOption.DELETE; this.oData = oDS.getData(id); if (this.oData == null) { return(HttpNotFound()); } prepareLookup(); return(View(this.oData)); }
public ActionResult Details(int?id = null) { //ViewBag.AC_MENU_ID = valMENU.MODULE_DETAILS; ViewBag.CRUD_type = hlpFlags_CRUDOption.VIEW; ViewBag.CRUDSavedOrDelete = TempData["CRUDSavedOrDelete"]; this.oData = oDS.getData(id); if (this.oData == null) { return(HttpNotFound()); } prepareLookup(); return(View(this.oData)); }
//BL //MAP //Init private void initConstructor(DBMAINContext poDB) { //DBContext this.db = poDB; //VM this.oVM = new EmployeeuserVM(); //DS this.oDS = new EmployeeuserDS(this.db); this.oDSUnit = new UnitDS(this.db); this.oDSJobtitle = new JobtitleDS(this.db); this.oDSRole = new RoleDS(this.db); //CRUD this.oCRUD = new EmployeeuserCRUD(this.db); //BL //MAP } //End initConstructor