public void Update(StockShiftConfigVM vm, Action callback) { string relativeUrl = "/InventoryService/StockShiftConfig/Update"; restClient.Update(relativeUrl, vm.ConvertVM <StockShiftConfigVM, StockShiftConfigInfo>(), (obj, args) => { if (!args.FaultsHandle() && callback != null) { callback(); } }); }
public void Create(StockShiftConfigVM vm, Action <StockShiftConfigVM> callback) { vm.CompanyCode = CPApplication.Current.CompanyCode; string relativeUrl = "/InventoryService/StockShiftConfig/Create"; restClient.Create <StockShiftConfigInfo>(relativeUrl, vm.ConvertVM <StockShiftConfigVM, StockShiftConfigInfo>(), (obj, args) => { if (!args.FaultsHandle()) { vm = null; if (args.Result != null) { vm = args.Result.Convert <StockShiftConfigInfo, StockShiftConfigVM>(); } if (callback != null) { callback(vm); } } }); }