Пример #1
0
        /// <summary>
        /// Tạo mới một Cat_Brand
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult Create([Bind] Cat_BrandModel model)
        {
            var service = new RestServiceClient <Cat_UnitModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
            var result = service.Put(_hrm_Hr_Service, "api/Cat_Unit/", model);

            return(Json(result));
        }
Пример #2
0
        public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Cat_BrandModel user)
        {
            var service = new RestServiceClient <Cat_BrandModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
            var result = service.Put(_hrm_Hr_Service, "api/Cat_Brand/", user);

            return(Json(result));
        }
Пример #3
0
 public Cat_BrandModel Post([Bind] Cat_BrandModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Cat_BrandModel>(model, "Cat_Brand", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_BrandEntity, Cat_BrandModel>(model));
 }
Пример #4
0
        /// <summary>
        /// [T Lấy dữ liệu Thương Hiệu(Cat_Brand) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Cat_BrandModel GetById(Guid id)
        {
            string status  = string.Empty;
            var    model   = new Cat_BrandModel();
            var    service = new ActionService(UserLogin);
            var    entity  = service.GetByIdUseStore <Cat_BrandEntity>(id, ConstantSql.hrm_cat_sp_get_BrandByIds, ref status);

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