public void SetPayItem(PayMode mode) { IEnumerable <PayItem> pays = this.itemsPay.ItemsSource as IEnumerable <PayItem>; var payItem = pays.FirstOrDefault(o => o.Mode == mode); if (payItem != null) { switch (PayAction) { case Models.PosModels.PayAction.RefundAll: case Models.PosModels.PayAction.Refund: case Models.PosModels.PayAction.Change: if (payItem.Mode != PayMode.CashPay) { Toast.ShowMessage("退换货当前只允许现金支付!", this); return; } break; } PayItem = payItem; txtChoosePay.Text = "已选择" + PayItem.Title; } //Task.Factory.StartNew(() => //{ // Thread.Sleep(300); // this.Dispatcher.Invoke(new Action(() => // { // txtAmount.Focus(); // })); //}); }
public ActionResult AddPayItem(PayItem payItem) { if (Session["CurrentUser"] != null) { if (!ModelState.IsValid) { return(AjaxResult("error", "数据格式不正确")); } PayItem temp = db.PayItem.Where(u => u.piName == payItem.piName && u.piDeleted != true).SingleOrDefault(); if (temp != null) { return(AjaxResult("error", "添加失败,已经存在此支出项")); } UserAccount currentUser = Session["CurrentUser"] as UserAccount; payItem.piUpdatedBy = currentUser.uaId; payItem.piUpdatedDate = DateTime.Now; payItem.piRemark = payItem.piRemark == null ? "" : payItem.piRemark; db.PayItem.Add(payItem); db.SaveChanges(); return(AjaxResult("success", "添加成功")); } else { return(AjaxResult("error", "未登陆")); } }
public async Task CreatePayItemTest() { PayItem payItem = new PayItem(); var response = await instance.CreatePayItemAsync(accessToken, xeroTenantId, payItem); Assert.IsType <PayItems>(response); }
public void AddPayItemValues(double Quantitiy, double Amount, string Description, string ftPayItemCase) { var item = new PayItem(); item.Quantity = Quantitiy; item.Amount = Amount; item.Description = Description; item.ftPayItemCase = ftPayItemCase; _requestPayItems.Add(item.ftPayItem()); }
public void AddPay(PayItem payItem, decimal amount) { if (payItem != null) { //if (amount <= 0) //{ // Toast.ShowMessage("支付金额应大于0!", this); // return; //} if ((MultiPayViewModel.PayAction == PayAction.Refund || MultiPayViewModel.PayAction == PayAction.Change || MultiPayViewModel.PayAction == PayAction.RefundAll) && MultiPayViewModel.Amount < 0 && amount > 0) { amount = -amount; } var cashCoupon = 0m; cashCoupon = MultiPayViewModel.PayItems.Where(o => o.PayItem != null && o.PayItem.Mode == PayMode.CashCoupon).Sum(o => o.Amount); var notCash = MultiPayViewModel.PayItems.Where(o => o.PayItem != null && o.PayItem.Mode != PayMode.CashPay && o.PayItem.Mode != PayMode.CashCoupon).Sum(o => o.Amount); switch (payItem.Mode) { case PayMode.CashPay: break; case PayMode.CashCoupon: cashCoupon += amount; break; default: notCash += amount; break; } var needNotCash = (MultiPayViewModel.WipeZeroAfter - cashCoupon); if (notCash > needNotCash && notCash > 0) { Toast.ShowMessage("非现金收款金额超出!", this); return; } MultiPayViewModel.CurrentPayItem = new MultiPayItemViewModel() { IsFrist = false, PayItem = payItem, CurrentWindow = this, IsLast = false, IsSelected = true, Amount = amount, PayName = payItem.Title }; MultiPayViewModel.PayItems.Insert(MultiPayViewModel.PayItems.Count - 1, MultiPayViewModel.CurrentPayItem); Statistics(); switch (payItem.Mode) { case PayMode.StoredValueCard: case PayMode.UnionPayCTPOSM: case PayMode.RongHeDynamicQRCodePay: MultiPayViewModel.CurrentPayItem.DoPay(); break; } } }
public ActionResult DeletePayItem(int piId) { if (Session["CurrentUser"] != null) { PayItem temp = db.PayItem.Where(u => u.piId == piId).SingleOrDefault(); UserAccount currentUser = Session["CurrentUser"] as UserAccount; temp.piUpdatedBy = currentUser.uaId; temp.piUpdatedDate = DateTime.Now; temp.piDeleted = true; db.SaveChanges(); return(AjaxResult("success", "删除成功")); } else { return(AjaxResult("error", "未登陆")); } }
public void DrawPayTable(GameObject payItemPrefab) { for (int i = sprites.Length - 1; i >= 0; i--) { GameObject go = Instantiate(payItemPrefab) as GameObject; Transform tr = go.transform; tr.SetParent(transform); tr.localScale = Vector3.one; tr.localPosition = Vector3.zero; PayItem pItem = go.GetComponent <PayItem>(); pItem.sprite.sprite = sprites[i]; pItem.labels[0].text = "5x - " + PayData.table[i, 4]; pItem.labels[1].text = "4x - " + PayData.table[i, 3]; pItem.labels[2].text = "3x - " + PayData.table[i, 2]; pItem.labels[3].text = ""; } }
public void AddPayItem(PayItem item) { _requestPayItems.Add(item.ftPayItem()); }
internal void PosCancelButton_Click(object sender, RoutedEventArgs e) { PayItem = null; isCannel = true; this.Close(); }
public MultiPay(decimal amount, PayAction action, PayItem _payItem) : this(amount, action) { this.payItem = _payItem; }