Esempio n. 1
0
        public Sal_ItemForShopModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Sal_ItemForShopModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Sal_ItemForShopEntity>(id, ConstantSql.hrm_sal_sp_get_ItemForShopById, ref status);//note

            if (entity != null)
            {
                model = entity.CopyData <Sal_ItemForShopModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Esempio n. 2
0
        public Sal_ItemForShopModel Post([Bind] Sal_ItemForShopModel model)
        {
            #region Validate
            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Sal_ItemForShopModel>(model, "Sal_ItemForShop", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }
            #endregion

            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <Sal_ItemForShopEntity, Sal_ItemForShopModel>(model));
        }