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