Ejemplo n.º 1
0
        /// <summary>
        /// Tạo mời một CatProvince
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult Create([Bind] CatProvinceModel model)
        {
            var service = new RestServiceClient <CatProvinceModel>(UserLogin);

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

            return(Json(result));
        }
Ejemplo n.º 2
0
 public CatProvinceModel Post([Bind] CatProvinceModel model)
 {
     #region Validate
     string message       = string.Empty;
     var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <CatProvinceModel>(model, "Cat_Province", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return(model);
     }
     #endregion
     ActionService service = new ActionService(UserLogin);
     return(service.UpdateOrCreate <Cat_ProvinceEntity, CatProvinceModel>(model));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// [Tin.Nguyen] - Lấy dữ liệu Loại Thiết Bị(Cat_Category) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public CatProvinceModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new CatProvinceModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Cat_ProvinceEntity>(id, ConstantSql.hrm_cat_sp_get_ProvinceById, ref status);

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