Пример #1
0
        private void Grid_OrderInfo_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            //1.初始化查询条件
            //2.请求服务查询
            PagingInfo p = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };

            NeweggAmbassadorFacade facade = new NeweggAmbassadorFacade(CPApplication.Current.CurrentPage);

            if (facade != null)
            {
                facade.QueryAmbassadorRecommendOrderInfo(_CurrentQueryVM, p, (s, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    var orderInfoRows   = args.Result[0].Rows.ToList();
                    var summaryInfoRows = args.Result[1].Rows.ToList();

                    this.Grid_OrderInfo.ItemsSource = orderInfoRows;
                    this.Grid_OrderInfo.TotalCount  = args.Result[0].TotalCount;

                    this.Grid_SummaryInfo.ItemsSource = summaryInfoRows;
                    this.Grid_SummaryInfo.Bind();
                });
            }
        }
Пример #2
0
        /// <summary>
        /// 取消申请。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BTN_UnApply_Click(object sender, RoutedEventArgs e)
        {
            List <NeweggAmbassadorSatusInfo> neweggAmbassadorStatusInfos = GetAmbassadorInfosByChangeStatus(AmbassadorStatus.Canceled);

            if (neweggAmbassadorStatusInfos == null || neweggAmbassadorStatusInfos.Count <= 0)
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResNeweggAmbassador.Info_NoUnActiveItems);
                return;
            }

            NeweggAmbassadorFacade facade = new NeweggAmbassadorFacade(CPApplication.Current.CurrentPage);


            //取消申请。
            facade.CancelRequestNeweggAmbassadorStatus(neweggAmbassadorStatusInfos, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                CPApplication.Current.CurrentPage.Context.Window.Alert(ResNeweggAmbassador.Info_SucessBatchDeal);

                this.Grid_AmbassadorBasicInfoList.Bind();
                return;
            });
        }
Пример #3
0
        private void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            //1.初始化查询条件
            //2.请求服务查询
            PagingInfo p = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };

            NeweggAmbassadorFacade facade = new NeweggAmbassadorFacade(CPApplication.Current.CurrentPage);

            if (facade != null)
            {
                _CurrentQueryVM.AreaSysNo = _CurrentQueryVM.GetAreaSysNo();
                facade.QueryAmbassadorBasicInfo(_CurrentQueryVM, p, (s, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    var rows = args.Result.Rows.ToList();

                    this.Grid_AmbassadorBasicInfoList.ItemsSource = rows;
                    this.Grid_AmbassadorBasicInfoList.TotalCount  = args.Result.TotalCount;
                });
            }
        }
Пример #4
0
        private void Grid_OrderInfo_ExportAllClick(object sender, EventArgs e)
        {
            NeweggAmbassadorFacade facade = new NeweggAmbassadorFacade(CPApplication.Current.CurrentPage);

            ColumnSet columnSet = new ColumnSet(this.Grid_OrderInfo);

            facade.ExportAllRecommendOrderInfoToExcel(_CurrentQueryVM, new ColumnSet[] { columnSet });
        }
Пример #5
0
        /// <summary>
        /// 激活。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BTN_Active_Click(object sender, RoutedEventArgs e)
        {
            List <NeweggAmbassadorSatusInfo> neweggAmbassadorStatusInfos = GetAmbassadorInfosByChangeStatus(AmbassadorStatus.Active);

            if (neweggAmbassadorStatusInfos == null || neweggAmbassadorStatusInfos.Count <= 0)
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResNeweggAmbassador.Info_NoUnActiveOrCanceledItems);
                return;
            }

            NeweggAmbassadorFacade facade = new NeweggAmbassadorFacade(CPApplication.Current.CurrentPage);

            facade.TryUpdateAmbassadorStatus(neweggAmbassadorStatusInfos, (s, args) =>
            {//尝试更新泰隆优选大使的状态,返回需要确认的泰隆优选大使。
                if (args.FaultsHandle())
                {
                    return;
                }
                if (args.Result == null)
                {
                    return;
                }

                NeweggAmbassadorBatchInfo confirmBatch = args.Result as NeweggAmbassadorBatchInfo;//需要确认更新的泰隆优选大使。

                if (confirmBatch == null || confirmBatch.NeweggAmbassadors == null || confirmBatch.NeweggAmbassadors.Count <= 0)
                {
                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResNeweggAmbassador.Info_SucessBatchDeal);
                    return;
                }

                List <NeweggAmbassadorSatusInfo> updateNeweggAmbassadors = new List <NeweggAmbassadorSatusInfo>();

                string alertString = "";
                foreach (NeweggAmbassadorSatusInfo ambassadorStatusInfo in confirmBatch.NeweggAmbassadors)
                {
                    dynamic item = GetAmbassadorItemBySysNo(ambassadorStatusInfo.AmbassadorSysNo.Value);
                    if (item == null)
                    {
                        continue;
                    }

                    NeweggAmbassadorSatusInfo swapStatusInfo = new NeweggAmbassadorSatusInfo();
                    swapStatusInfo.AmbassadorSysNo           = ambassadorStatusInfo.AmbassadorSysNo;
                    swapStatusInfo.OrignCustomerMark         = ambassadorStatusInfo.OrignCustomerMark;
                    swapStatusInfo.CompanyCode = ambassadorStatusInfo.CompanyCode;

                    updateNeweggAmbassadors.Add(swapStatusInfo);

                    alertString += string.Format(ResNeweggAmbassador.Info_IfActive, item.AmbassadorID, item.CanceledTime, item.CanceledPerson);
                }

                CPApplication.Current.CurrentPage.Context.Window.Confirm(ResNeweggAmbassador.Title_Confirm, alertString, (ss, resultArgs) => {//确认更新。
                    if (resultArgs.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK)
                    {
                        facade.MaintainNeweggAmbassadorStatus(updateNeweggAmbassadors, (sss, confirmArgs) =>
                        {
                            if (args.FaultsHandle())
                            {
                                return;
                            }

                            CPApplication.Current.CurrentPage.Context.Window.Alert(ResNeweggAmbassador.Info_SucessBatchDeal);

                            this.Grid_AmbassadorBasicInfoList.Bind();
                            return;
                        });

                        this.Grid_AmbassadorBasicInfoList.Bind();
                    }
                }, Newegg.Oversea.Silverlight.Controls.Components.ButtonType.YesNo);
            });
        }