private void RemoveConsignmentBill(object obj) { if (SelectedConsignmentBill.SelectedStatus > 0) { //移除数据求和 SelectedConsignmentBillLists.Remove(SelectedConsignmentBillLists.FirstOrDefault(x => x.InterId == SelectedConsignmentBill.InterId)); SelectedConsignmentSum = SelectedConsignmentBillLists.Where(m => m.SelectedStatus > 0).Sum(m => m.CurrencyQuantity); // 修改选择状态 SelectedConsignmentBill.SelectedStatus = 0; // 同步数据到数据库 _consignmentService.DeleteConsignmentBill(SelectedConsignmentBill); } }
private void UnSelectedAllConsignmentBill(object obj) { if (ConsignmentBills.Count == 0) { return; } if (ConsignmentBills.Where(m => m.SelectedStatus > 0).Count() > 0)// 反选 { var bills = ConsignmentBills.Where(m => m.SelectedStatus > 0); if (bills.Count() > 0) { StringBuilder sb = new StringBuilder(); foreach (var item in bills) { SelectedConsignmentBillLists.Remove(SelectedConsignmentBillLists.FirstOrDefault(x => x.InterId == item.InterId)); sb.Append(",'" + item.BillNo + "'"); } _consignmentService.RemoveUserCurrencyOperation(sb.ToString().Substring(1)); SelectedConsignmentSum = SelectedConsignmentBillLists.Where(m => m.SelectedStatus > 0).Sum(m => m.CurrencyQuantity); QuerySignmentBill(null); } } }