public Cat_AccidentTypeModel Post([Bind] Cat_AccidentTypeModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_AccidentTypeModel>(model, "Cat_AccidentType", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); return(service.UpdateOrCreate <Cat_AccidentTypeEntity, Cat_AccidentTypeModel>(model)); }
// // GET: /Cat_AccidentType/ public Cat_AccidentTypeModel GetById(Guid id) { string status = string.Empty; var model = new Cat_AccidentTypeModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Cat_AccidentTypeEntity>(id, ConstantSql.hrm_cat_sp_get_AccidentTypeById, ref status); if (entity != null) { model = entity.CopyData <Cat_AccidentTypeModel>(); } model.ActionStatus = status; return(model); }