public CatNameEntityModel GetById(Guid id) { string status = string.Empty; var model = new CatNameEntityModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Cat_NameEntityEntity>(id, ConstantSql.hrm_cat_sp_get_NameEntityById, ref status); if(entity!= null) { model = entity.CopyData<CatNameEntityModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// xoa hay cap nhat mot doi tuong /// </summary> /// <param name="model"></param> /// <returns></returns> public CatNameEntityModel Post([Bind] CatNameEntityModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <CatNameEntityModel>(model, "Cat_TypeOfStop", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); return(service.UpdateOrCreate <Cat_NameEntityEntity, CatNameEntityModel>(model)); }
public CatNameEntityModel GetById(Guid id) { string status = string.Empty; var model = new CatNameEntityModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Cat_NameEntityEntity>(id, ConstantSql.hrm_cat_sp_get_NameEntityById, ref status); if (entity != null) { model = entity.CopyData <CatNameEntityModel>(); } model.ActionStatus = status; return(model); }