/// <summary> /// 初始化 /// </summary> public void Init(object obj) { Takeout model = obj as Takeout; if (null != model.tb_takeoutdetail) { details = model.tb_takeoutdetail.ToList(); } else { details = new List <TakeoutDetail>(); } if (null != model.tb_takeoutpay) { payList = model.tb_takeoutpay.ToList(); } else { payList = new List <TakeoutPay>(); } this.tempPayList = payList.ToList(); takeout = model.FastCopy(); if (!string.IsNullOrWhiteSpace(takeout.Remark)) { this.ChangePaidPrice.Remark = takeout.Remark; } else { this.ChangePaidPrice.Remark = null; } takeout.tb_member = model.tb_member; Calc(); if (!IsScanReady) { IsScanReady = true; // 刷卡 Notification.Instance.NotificationCardReader += Instance_NotificationCardReader; } _element.RaiseEvent(new BoxRoutedEventArgs(PublicEvents.BoxEvent, null, null, null, BoxType.ChangePaidPrice, model)); }
/// <summary> /// 初始化 /// </summary> public void Init(object obj) { this.PaidPrice = "0"; this.MemberPaidPrice = "0"; this.BalanceMode = 0; Takeout model = obj as Takeout; if (null != model.tb_takeoutdetail) { details = model.tb_takeoutdetail.ToList(); } else { details = new List <TakeoutDetail>(); } if (null != model.tb_takeoutpay) { payList = model.tb_takeoutpay.ToList(); } else { payList = new List <TakeoutPay>(); } this.tempPayList = payList.ToList(); takeout = model.FastCopy(); if (!string.IsNullOrWhiteSpace(takeout.Remark)) { this.ChangePaidPrice.Remark = takeout.Remark; } else { this.ChangePaidPrice.Remark = null; } takeout.tb_member = model.tb_member; Calc(); }
public TakeoutCheckoutWindow(Takeout model, bool IsRechecked = false) { if (null != model.tb_takeoutdetail) { details = model.tb_takeoutdetail.ToList(); } else { details = new List <TakeoutDetail>(); } if (null != model.tb_takeoutpay) { payList = model.tb_takeoutpay.ToList(); } else { payList = new List <TakeoutPay>(); } this.tempPayList = payList.ToList(); takeout = model.FastCopy(); this.IsRechecked = IsRechecked; takeout.tb_member = model.tb_member; InitializeComponent(); this.Text = Resources.GetRes().GetString("CheckoutOrder"); krplTotalPrice.Text = Resources.GetRes().GetString("TotalPrice"); krplPaidPrice.Text = Resources.GetRes().GetString("PaidPrice"); krpbCheckout.Text = Resources.GetRes().GetString("CheckoutOrder"); krplBorrowPrice.Text = Resources.GetRes().GetString("OwedPrice"); krplKeepPrice.Text = Resources.GetRes().GetString("KeepPrice"); krplMemberPaidPrice.Text = Resources.GetRes().GetString("MemberPaidPrice"); krplTotalPaidPrice.Text = Resources.GetRes().GetString("TotalPaidPrice"); Assembly asm = Assembly.LoadFrom(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Res.dll")); this.Icon = new Icon(asm.GetManifestResourceStream(@"Oybab.Res.Resources.Images.PC.CheckoutOrder.ico")); payWindow = new PriceCommonChangeWindow("+", takeout.TotalPrice, tempPayList.Select(x => new CommonPayModel(x)).ToList(), true, true, Recalc); payWindow.StartLoad += (x, y) => { this.StartLoad(x, y); }; payWindow.StopLoad += (x, y) => { this.StopLoad(x, y); }; payWindow.TopLevel = false; pnPrice.Controls.Add(payWindow); payWindow.Show(); Calc(); // 刷卡 Notification.Instance.NotificationCardReader += Instance_NotificationCardReader; }