예제 #1
0
 public Cat_UnitPriceModel Post([Bind] Cat_UnitPriceModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_UnitPriceModel>(model, "Cat_UnitPrice", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_UnitPriceEntity, Cat_UnitPriceModel>(model));
 }
예제 #2
0
        public Cat_UnitPriceModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Cat_UnitPriceModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_UnitPriceEntity>(id, ConstantSql.hrm_cat_sp_get_UnitPriceById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <Cat_UnitPriceModel>();
            }
            model.ActionStatus = status;
            return(model);
        }