public OrderDetailsViewModel(string paySn) { Task.Factory.StartNew(() => { MachineInformations _machinesInfo = Global.MachineSettings.MachineInformations; FindBillHistoryParams _params = new FindBillHistoryParams() { StoreId = _machinesInfo.StoreId, MachineSn = _machinesInfo.MachineSn, CID = _machinesInfo.CompanyId, PaySn = paySn }; var result = ApiManager.Post <FindBillHistoryParams, ApiRetrunResult <BillHistoryInfo> >(@"api/FindBillHistory", _params); if (result.Code == "200") { Application.Current.Dispatcher.Invoke(new Action(() => { var orderTypeInt = result.Result.OrderType; var status = result.Result.OrderStatus;//type=0正常 1换货 2退货 status=0正常 1退单 if (status == 1) { OrderType = "退单"; } else { if (orderTypeInt == 1 || orderTypeInt == 2) { OrderType = "退换"; } else { OrderType = "销售"; } } PaySn = result.Result.PaySn; CreateDT = result.Result.OrderTime; PayType = result.Result.Payment; CashierName = result.Result.CashierName; SaleManName = result.Result.SaleManName; TotalAmount = result.Result.WipeZeroAfterTotalAmount; WipeZero = result.Result.WipeZero; PreferentialAmount = result.Result.PreferentialAmount; Unit = result.Result.ProductCount; OrderItems = result.Result.Details; OldOrderSN = result.Result.OldOrderSN; OrderDiscount = -result.Result.OrderDiscount;//2016-08-03 整单让利数据源变成正的加- })); } else { Application.Current.Dispatcher.Invoke(new Action(() => { Toast.ShowMessage(result.Message, CurrentWindow); })); } }); }
internal void Reload(MachineInformations machineInformations) { MachineSn = machineInformations.MachineSn; StoreId = machineInformations.StoreId; StoreName = machineInformations.StoreName; Phone = machineInformations.Phone; Company = machineInformations.Company; CompanyId = machineInformations.CompanyId; PrintStatus = machineInformations.PrintStatus; DeviceId = machineInformations.DeviceId; IsNonCashWipeZero = machineInformations.IsNonCashWipeZero; }