public ActionResult Index() { SetDefaulButton(StandardButtonMode.Index); if (TempSearch.IsDefaultSearch && !Request.GetRequest("page").IsNullOrEmpty()) { localModel = TempSearch.CloneObject(); } SetDefaultData(StandardActionName.Index); return(View(StandardActionName.Index, localModel)); }
public ActionResult SaveModify(MSTS02P001Model model) { var jsonResult = new JsonResult(); if (ModelState.IsValid) { var result = SaveData(StandardActionName.SaveModify, model); jsonResult = Success(result, StandardActionName.SaveModify, Url.Action(StandardActionName.Index, new { page = 1 })); } else { jsonResult = ValidateError(ModelState, StandardActionName.SaveModify); } return(jsonResult); }
public ActionResult Search(MSTS02P001Model model) { var da = new MSTS02P001DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = MSTS02P001ExecuteType.GetAll; if (Request.GetRequest("page").IsNullOrEmpty()) { model.IsDefaultSearch = true; TempSearch = model; } da.DTO.Model = TempSearch; SetStandardField(da.DTO.Model); da.SelectNoEF(da.DTO); return(JsonAllowGet(da.DTO.Models, da.DTO.Result)); }
public ActionResult SaveCreate(MSTS02P001Model model) { var jsonResult = new JsonResult(); if (ModelState.IsValid) { model.IS_USE = "F"; //defualt var result = SaveData(StandardActionName.SaveCreate, model); jsonResult = Success(result, StandardActionName.SaveCreate, Url.Action(StandardActionName.Index, new { page = 1 })); } else { jsonResult = ValidateError(ModelState, StandardActionName.SaveCreate); } return(jsonResult); }
public ActionResult Edit(MSTS02P001Model model) { var da = new MSTS02P001DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = MSTS01P001ExecuteType.GetByID; da.DTO.Model.YEAR = model.YEAR; da.DTO.Model.COM_CODE = model.COM_CODE; da.SelectNoEF(da.DTO); localModel = da.DTO.Model; SetDefaulButton(StandardButtonMode.Modify); SetDefaultData(); //set ค่า DDL return(View(StandardActionName.Edit, localModel)); }