/// <summary> /// Tạo mời một CatRegion /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult Create([Bind] CatRegionModel model) { var service = new RestServiceClient <CatRegionModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/CatRegion/", model); return(Json(result)); }
public CatRegionModel Post([Bind] CatRegionModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <CatRegionModel>(model, "Cat_Region", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); return(service.UpdateOrCreate <Cat_RegionEntity, CatRegionModel>(model)); }
/// <summary> /// [Tam.Le] - Lấy dữ liệu Vùng Miền(Cat_Region) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public CatRegionModel GetById(Guid id) { string status = string.Empty; var model = new CatRegionModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Cat_RegionEntity>(id, ConstantSql.hrm_cat_sp_get_RegionById, ref status); if (entity != null) { model = entity.CopyData <CatRegionModel>(); } model.ActionStatus = status; return(model); }