示例#1
0
        public Sal_RevenueForProfileModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Sal_RevenueForProfileModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Sal_RevenueForProfileEntity>(id, ConstantSql.hrm_sal_sp_get_RevenueForProfileById, ref status);//note

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

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