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