Esempio n. 1
0
        private void SaleGiftProcess(PSOperationType opt, string optname, SaleGiftStatus targetStatus)
        {
            List <int?> sysNoList = new List <int?>();

            sysNoList.Add(_saleGiftInfoVM.SysNo);

            _facade.BatchProcessSaleGift(sysNoList, opt, (obj, args) =>
            {
                if (args.Result.FailureRecords.Count == 0)
                {
                    if (opt == PSOperationType.SubmitAudit)
                    {
                        _facade.Load(_saleGiftInfoVM.SysNo, _saleGiftInfoVM, (obj1, args1) =>
                        {
                            _saleGiftInfoVM  = args1.Result;
                            this.DataContext = _saleGiftInfoVM;
                            SetControlByOperation();
                        });
                    }
                    else
                    {
                        _saleGiftInfoVM.Status = targetStatus;
                        SetControlByOperation();
                    }
                    //Window.Alert(string.Format("赠品活动-{0}成功!", optname));
                    Window.Alert(string.Format(ResSaleGiftMaitain.Msg_DealSuccess, optname));
                }
                else
                {
                    string msg = args.Result.FailureRecords.Join("\r\n") + Environment.NewLine;
                    Window.Alert(msg);
                }
            });
        }
Esempio n. 2
0
        private void BatchProcess(PSOperationType opt, string optname)
        {
            Window.MessageBox.Show("商家创建的商品为待审核时不能撤回,如有勾选,系统会自动忽略!", MessageBoxType.Information);
            dynamic rows = dgResult.ItemsSource;

            if (rows == null)
            {
                //Window.Alert("请至少勾选一条数据!");
                Window.Alert(ResSaleGiftQuery.Msg_SelcOneMoreRecords);
                return;
            }
            List <int?> sysNoList = new List <int?>();

            foreach (dynamic row in rows)
            {
                if (row.IsChecked && row.RequestSysNo == 0)
                {
                    sysNoList.Add(row.SysNo);
                }
            }
            if (sysNoList.Count == 0)
            {
                // Window.Alert("请至少勾选一条数据!");
                Window.Alert(ResSaleGiftQuery.Msg_SelcOneMoreRecords);
                return;
            }
            _facade.BatchProcessSaleGift(sysNoList, opt, (obj, args) =>
            {
                if (args.Result.FailureRecords.Count == 0)
                {
                    //Window.Alert(string.Format("批量{0}赠品成功!", optname));
                    Window.Alert(string.Format(ResSaleGiftQuery.Msg_BatchDealSuccess, optname));
                }
                else
                {
                    string msg = args.Result.FailureRecords.Join(Environment.NewLine) + Environment.NewLine;
                    if (args.Result.SuccessRecords.Count > 0)
                    {
                        // msg += "其余赠品活动处理成功:" + Environment.NewLine;
                        msg += ResSaleGiftQuery.Msg_DealSuccess + Environment.NewLine;
                        msg += args.Result.SuccessRecords.Join(Environment.NewLine);
                    }
                    Window.Alert(msg);
                }
                ButtonSearch_Click(this.ButtonSearch, new RoutedEventArgs());
            });
        }