/// <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)); }
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)); }
/// <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); }