public ActionResult Add(SIMREG_DELIVEREDBYViewModel model) { try { if (ModelState.IsValid) { _boSIMREG_DELIVEREDBY = new BOSIMREG_DELIVEREDBY(); var beSIMREG_DELIVEREDBY = new BESIMREG_DELIVEREDBY { DELIVEREDBYID = model.DELIVEREDBYID, TITLE = model.TITLE, USERNAME = model.USERNAME, IDATE = DateTime.Now, IUSER = model.IUSER, EDATE = DateTime.Now, EUSER = model.EUSER, IsNew = true }; _boSIMREG_DELIVEREDBY.Save(beSIMREG_DELIVEREDBY); return Content(Boolean.TrueString); } return Content(ExceptionHelper.ModelStateErrorFormat(ModelState)); } catch (Exception ex) { ExceptionHelper.ExceptionMessageFormat(ex); return Content("Sorry! Unable to add this data."); } }
// // GET: /DELIVEREDBY/Add public ActionResult Add() { try { var sIMREG_DELIVEREDBYViewModel = new SIMREG_DELIVEREDBYViewModel(); return PartialView("_Add", sIMREG_DELIVEREDBYViewModel); } catch (Exception ex) { ExceptionHelper.ExceptionMessageFormat(ex); return PartialView("_Error", ex); } }
// // GET: /DELIVEREDBY/Delete/by id public ActionResult Delete(int id) { try { _boSIMREG_DELIVEREDBY = new BOSIMREG_DELIVEREDBY(); var sIMREG_DELIVEREDBY = _boSIMREG_DELIVEREDBY.GetSIMREG_DELIVEREDBY(id); if (sIMREG_DELIVEREDBY != null) { var sIMREG_DELIVEREDBYViewModel = new SIMREG_DELIVEREDBYViewModel { DELIVEREDBYID = sIMREG_DELIVEREDBY.DELIVEREDBYID, TITLE = sIMREG_DELIVEREDBY.TITLE, USERNAME = sIMREG_DELIVEREDBY.USERNAME, //IDATE = sIMREG_DELIVEREDBY.IDATE, //IUSER = sIMREG_DELIVEREDBY.IUSER, //EDATE = sIMREG_DELIVEREDBY.EDATE, //EUSER = sIMREG_DELIVEREDBY.EUSER }; return PartialView("_Delete", sIMREG_DELIVEREDBYViewModel); } else { return PartialView("_Error", "Could not found, your request data."); } } catch (Exception ex) { ExceptionHelper.ExceptionMessageFormat(ex); return PartialView("_Error", ex); } }
public ActionResult Edit(SIMREG_DELIVEREDBYViewModel model) { try { if (ModelState.IsValid) { _boSIMREG_DELIVEREDBY = new BOSIMREG_DELIVEREDBY(); var sIMREG_DELIVEREDBY = _boSIMREG_DELIVEREDBY.GetSIMREG_DELIVEREDBY(model.DELIVEREDBYID); if (sIMREG_DELIVEREDBY != null) { sIMREG_DELIVEREDBY.DELIVEREDBYID = model.DELIVEREDBYID; sIMREG_DELIVEREDBY.TITLE = model.TITLE; sIMREG_DELIVEREDBY.USERNAME = model.USERNAME; //sIMREG_DELIVEREDBY.IDATE = model.IDATE; //sIMREG_DELIVEREDBY.IUSER = model.IUSER; sIMREG_DELIVEREDBY.EDATE = DateTime.Now; sIMREG_DELIVEREDBY.EUSER = model.EUSER; sIMREG_DELIVEREDBY.IsNew = false; _boSIMREG_DELIVEREDBY.Save(sIMREG_DELIVEREDBY); return Content(Boolean.TrueString); } else { return Content("Could not found, your request data."); } } return Content(ExceptionHelper.ModelStateErrorFormat(ModelState)); } catch (Exception ex) { ExceptionHelper.ExceptionMessageFormat(ex); return Content("Sorry! Unable to edit this data."); } }