public ActionResult Edit(JobtitleVM poViewModel) { ViewBag.AC_MENU_ID = valMENU.MST_JOBTITLE_EDIT; this.oVAL = new Jobtitle_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); 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 })); } return(View(poViewModel)); }
public ActionResult Edit(int? id = null) { ViewBag.AC_MENU_ID = valMENU.MST_JOBTITLE_EDIT; ViewBag.CRUD_type = hlpFlags_CRUDOption.UPDATE; this.oData = oDS.getData(id); if (this.oData == null) { return HttpNotFound(); } return View(this.oData); }
public ActionResult Details(int? id = null) { ViewBag.AC_MENU_ID = valMENU.MST_JOBTITLE_DETAILS; ViewBag.CRUD_type = hlpFlags_CRUDOption.VIEW; ViewBag.CRUDSavedOrDelete = TempData["CRUDSavedOrDelete"]; this.oData = oDS.getData(id); if (this.oData == null) { return HttpNotFound(); } return View(this.oData); }
public ActionResult Delete(int? id = null) { //Hardcode return RedirectToAction("Details", new { id = 1 }); //ViewBag.AC_MENU_ID = valMENU.MODULE_DELETE; ViewBag.CRUD_type = hlpFlags_CRUDOption.DELETE; this.oData = oDS.getData(id); if (this.oData == null) { return HttpNotFound(); } return View(this.oData); }
//BL //MAP //Init private void initConstructor(DBMAINContext poDB) { //DBContext this.db = poDB; //VM this.oVM = new JobtitleVM(); //DS this.oDS = new JobtitleDS(this.db); //CRUD this.oCRUD = new JobtitleCRUD(this.db); //BL //MAP } //End initConstructor