Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        //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