private DTOResult SaveData(string mode, object model) { var da = new SEC003P001DA(); //ในกรณีที่มีการ SaveLog ให้ Include SetStandardLog ด้วย SetStandardLog( da.DTO, model, GetSaveLogConfig("dbo", "VSMS_DEPARTMENT", "DEPT_ID")); if (mode == StandardActionName.SaveCreate) { SetStandardField(model); da.DTO.Model = (SEC003P001Model)model; da.Insert(da.DTO); } else if (mode == StandardActionName.SaveModify) { SetStandardField(model); da.DTO.Model = (SEC003P001Model)model; da.Update(da.DTO); } else if (mode == StandardActionName.Delete) { da.DTO.Model = new SEC003P001Model(); SetStandardField(da.DTO.Model); da.DTO.Models = (List <SEC003P001Model>)model; da.Delete(da.DTO); } return(da.DTO.Result); }
public ActionResult Search(SEC003P001Model model) { var da = new SEC003P001DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = SEC003P001ExecuteType.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?DEPT_ID) { SetDefaulButton(StandardButtonMode.View); var da = new SEC003P001DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = DTOExecuteType.GetByID; TempModel.DEPT_ID = da.DTO.Model.DEPT_ID = DEPT_ID; da.Select(da.DTO); if (da.DTO.Model != null) { localModel = da.DTO.Model; } return(View(StandardActionName.Info, localModel)); }