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