private void BatchProcess(PSOperationType opt, string optname) { dynamic rows = dgResult.ItemsSource; if (rows == null) { Window.Alert(ResCouponQuery.Msg_SelcOneMoreRecords); return; } List <int?> sysNoList = new List <int?>(); foreach (dynamic row in rows) { if (row.IsChecked) { sysNoList.Add(row.SysNo); } } if (sysNoList.Count == 0) { Window.Alert(ResCouponQuery.Msg_SelcOneMoreRecords); return; } _facade.BatchProcessCoupons(sysNoList, opt, (obj, args) => { if (args.Result.FailureRecords.Count == 0) { Window.Alert(string.Format(ResCouponQuery.Msg_BatchDealSuccess, optname)); } else { string msg = args.Result.FailureRecords.Join(Environment.NewLine) + Environment.NewLine; if (args.Result.SuccessRecords.Count > 0) { msg += ResCouponQuery.Msg_DealSuccess + Environment.NewLine; msg += args.Result.SuccessRecords.Join(Environment.NewLine); } Window.Alert(msg); } ButtonSearch_Click(this.ButtonSearch, new RoutedEventArgs()); }); }
private void CouponsProcess(PSOperationType opt, string optname, CouponsStatus targetStatus) { List <int?> sysNoList = new List <int?>(); sysNoList.Add(_couponsInfoVM.SysNo); _facade.BatchProcessCoupons(sysNoList, opt, (obj, args) => { if (args.Result.FailureRecords.Count == 0) { _couponsInfoVM.Status = targetStatus; SetControlByOperation(); Window.Alert(string.Format(ResCouponMaintain.Msg_DealSuccess, optname)); } else { string msg = args.Result.FailureRecords.Join("\r\n") + Environment.NewLine; Window.Alert(msg); } }); }