private DTOResult SaveData(string mode, object model) { var da = new SECS01P002DA(); //ในกรณีที่มีการ SaveLog ให้ Include SetStandardLog ด้วย SetStandardLog( da.DTO, model, GetSaveLogConfig("dbo", "VSMS_CONFIG_GENERAL", "ID")); if (mode == StandardActionName.SaveCreate) { SetStandardField(model); da.DTO.Model = (SECS01P002Model)model; da.Insert(da.DTO); } else if (mode == StandardActionName.SaveModify) { SetStandardField(model); da.DTO.Model = (SECS01P002Model)model; da.Update(da.DTO); } else if (mode == StandardActionName.Delete) { da.DTO.Model = new SECS01P002Model(); SetStandardField(da.DTO.Model); da.DTO.Models = (List <SECS01P002Model>)model; da.Delete(da.DTO); } return(da.DTO.Result); }
public ActionResult BindSystem() { var da = new SECS01P002DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = SECS01P002ExecuteType.GetSystemDetail; da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE; da.DTO.Model.NAME = TempModel.NAME; da.SelectNoEF(da.DTO); return(JsonAllowGet(da.DTO.Model.SystemModels, da.DTO.Result)); }
public ActionResult Search(SECS01P002Model model) { var da = new SECS01P002DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = SECS01P002ExecuteType.GetAll; if (Request.GetRequest("page").IsNullOrEmpty()) { model.IsDefaultSearch = true; TempSearch = model; } da.DTO.Model = TempSearch; da.Select(da.DTO); return(JsonAllowGet(da.DTO.Models, da.DTO.Result)); }
public ActionResult Info(decimal ID) { SetDefaulButton(StandardButtonMode.View); var da = new SECS01P002DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = DTOExecuteType.GetByID; TempModel.ID = da.DTO.Model.ID = ID; da.Select(da.DTO); if (da.DTO.Model != null) { localModel = da.DTO.Model; } return(View(StandardActionName.Info, localModel)); }
public ActionResult Edit(string NAME) { SetDefaulButton(StandardButtonMode.Modify); var da = new SECS01P002DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = SECS01P002ExecuteType.GetByID; TempModel.NAME = da.DTO.Model.NAME = NAME; da.Select(da.DTO); if (da.DTO.Model != null) { localModel = da.DTO.Model; } return(View(StandardActionName.Edit, localModel)); }