示例#1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);

            CodeNamePairHelper.GetList(ConstValue.DomainName_Customer, "CompanyCustomer",
                                       (obj, args) =>
            {
                if (!args.FaultsHandle() && args.Result != null)
                {
                    customerCompanyList = args.Result;
                }
            });

            facade = new CustomerFacade(this);
            vm     = new CustomerVM();

            string customerSysNo = this.Request.Param;

            if (!string.IsNullOrEmpty(customerSysNo))
            {
                AppSettingHelper.GetSetting("Customer", "AvtarImageBasePath", (obj1, args1) =>
                {
                    int temp = 0;
                    if (int.TryParse(customerSysNo, out temp))
                    {
                        facade.GetCustomerBySysNo(temp, (obj, args) =>
                        {
                            if (args.FaultsHandle())
                            {
                                return;
                            }
                            if (args.Result == null)
                            {
                                Window.Alert(ResCustomerMaintain.Info_CustomerNoFound);
                                return;
                            }
                            if (args.Result != null)
                            {
                                vm = args.Result.Convert <CustomerInfo, CustomerVM>();

                                vm.BasicInfo = args.Result.BasicInfo.Convert <ECCentral.BizEntity.Customer.CustomerBasicInfo, CustomerBasicVM>();
                                vm.BasicInfo.CustomerSysNo  = args.Result.SysNo;
                                vm.BasicInfo.Rank           = args.Result.Rank;
                                vm.BasicInfo.CustomersType  = args.Result.CustomersType;
                                vm.BasicInfo.IsBadCustomer  = args.Result.IsBadCustomer;
                                vm.BasicInfo.LastLoginDate  = args.Result.LastLoginDate;
                                vm.BasicInfo.DwellAreaSysNo = args.Result.BasicInfo.DwellAreaSysNo == 0 ? null : args.Result.BasicInfo.DwellAreaSysNo.ToString();
                                if (!vm.BasicInfo.IsEmailConfirmed.Value)
                                {
                                    this.btnCancelConfirmEmail.IsEnabled = false;
                                }
                                else
                                {
                                    this.ucDetailInfo.txt_email.IsEnabled = false;
                                }
                                if (!vm.BasicInfo.CellPhoneConfirmed.Value)
                                {
                                    this.btnCancelConfirmPhone.IsEnabled = false;
                                }
                                else
                                {
                                    this.ucDetailInfo.txt_cellphone.IsEnabled = false;
                                }

                                vm.ExperienceInfo.CustomerSysNo = vm.SysNo;
                                vm.ExperienceInfo.TotalSOMoney  = Convert.ToInt32(Math.Round(args.Result.TotalSOMoney.Value).ToString());

                                vm.ScoreInfo = args.Result.Convert <CustomerInfo, ScoreVM>();
                                vm.ScoreInfo.CustomerSysNo    = args.Result.SysNo;
                                vm.ScoreInfo.CustomerName     = args.Result.BasicInfo.CustomerName;
                                vm.ScoreInfo.CardNo           = args.Result.VipCardNo;
                                vm.BasicInfo.CompanyCustomer  = args.Result.BasicInfo.CompanyCustomer.Value;
                                vm.BasicInfo.CompanyCustomers = this.customerCompanyList;

                                if (vm.AgentInfo == null || !vm.AgentInfo.CustomerSysNo.HasValue)
                                {
                                    vm.AgentInfo = new AgentInfoVM
                                    {
                                        CustomerSysNo = vm.SysNo
                                    };
                                }
                                vm.IsEdit = true;

                                vm.BasicInfo.OriginalIsBadCustomer = vm.BasicInfo.IsBadCustomer;
                                //清空备注的Required验证信息
                                vm.ExperienceInfo.ValidationErrors.Clear();
                                if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_LookCustomerPwd))
                                {
                                    vm.BasicInfo.Pwd = "******";
                                }
                                vm.BasicInfo.AvtarImageBasePath = args1.Result;
                                CommonDataFacade commonFacade   = new CommonDataFacade(this);
                                commonFacade.GetWebChannelList(true, (sender2, e2) =>
                                {
                                    var data = new List <WebChannelVM>();
                                    data.AddRange(e2.Result);
                                    vm.BasicInfo.WebChannelList = data;
                                    this.DataContext            = vm;
                                });
                            }
                        });
                    }
                });
            }
            else
            {
                vm.BasicInfo.Status           = CustomerStatus.InValid;
                vm.BasicInfo.CompanyCustomers = this.customerCompanyList;
            }
            CheckRights();

            facade.GetSociety(obj =>
            {
                vm.BasicInfo.Societies = obj;
                this.DataContext       = vm;
            });

            this.UCShippingAddressInfo.OnShipingAddressUpdated += new EventHandler(UCShippingAddressInfo_OnShipingAddressUpdated);
            this.UCValueAddedTaxInvoice.OnVATUpdated           += new EventHandler(UCValueAddedTaxInvoice_OnVATUpdated);
        }
示例#2
0
        private void IniPageData()
        {
            CommonDataFacade               = new CommonDataFacade(this);
            PageView                       = new SOQueryView();
            PageView.QueryInfo.SOSysNo     = SOSysNo;
            PageView.QueryInfo.CompanyCode = CPApplication.Current.CompanyCode;
            SOQueryFacade                  = new SOQueryFacade(this);
            SOFacade                       = new SOFacade(this);
            ExportSOQueryInfo              = new SOQueryVM();
            CommonDataFacade.GetStockList(true, (sender, e) =>
            {
                PageView.QueryInfo.StockList = e.Result;
            });

            CommonDataFacade.GetAllSystemUser(CPApplication.Current.CompanyCode, (obj, args) =>
            {
                List <ECCentral.BizEntity.Common.UserInfo> userList = new List <BizEntity.Common.UserInfo>();
                userList.Add(new BizEntity.Common.UserInfo {
                    SysNo = null, UserDisplayName = ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All
                });
                if (!args.FaultsHandle() && args.Result != null)
                {
                    userList.AddRange(args.Result);
                }
                cmbOutStockUser.ItemsSource = userList;
            });
            CommonDataFacade.GetCustomerServiceList(CPApplication.Current.CompanyCode, (r) =>
            {
                List <ECCentral.BizEntity.Common.UserInfo> userList = new List <BizEntity.Common.UserInfo>();
                userList.Add(new BizEntity.Common.UserInfo {
                    SysNo = null, UserDisplayName = ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All
                });
                if (r != null)
                {
                    userList.AddRange(r);
                }
                cmbAuditUser.ItemsSource = userList;
            });

            CodeNamePairHelper.GetList(ConstValue.DomainName_SO
                                       , new string[] { ConstValue.Key_FPStatus, ConstValue.Key_KFCType }
                                       , CodeNamePairAppendItemType.All, (sender, e) =>
            {
                if (e.Result != null)
                {
                    PageView.QueryInfo.FPStatusList = e.Result[ConstValue.Key_FPStatus];
                    PageView.QueryInfo.KFCTypeList  = e.Result[ConstValue.Key_KFCType];
                }
            });

            CodeNamePairHelper.GetList(ConstValue.DomainName_Common, ConstValue.Key_TimeRange, CodeNamePairAppendItemType.Custom_All, (sender, e) =>
            {
                PageView.QueryInfo.TimeRangeList = e.Result;
            });

            CommonDataFacade.GetWebChannelList(true, (sender, e) =>
            {
                cmbThirdPlatform.ItemsSource = e.Result;
            });

            spConditions.DataContext = PageView.QueryInfo;
            dataGridSO.DataContext   = PageView;
            if (!string.IsNullOrEmpty(PageView.QueryInfo.SOSysNo))
            {
                if (Regex.IsMatch(PageView.QueryInfo.SOSysNo, @"^\d+([, \.]+\d+)*$"))
                {
                    btnSearch_Click(null, null);
                }
            }
        }
示例#3
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            facade                 = new ProductConsultQueryFacade(this);
            filter                 = new ProductConsultQueryFilter();
            filterReply            = new ProductConsultReplyQueryFilter();
            model                  = new ProductConsultQueryVM();
            modelReply             = new ProductConsultReplyQueryVM();
            modelReply.ChannelID   = "1";
            model.ChannelID        = "1";
            model.CompanyCode      = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            modelReply.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;

            #region 咨询
            //商品状态
            comProductStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All);


            //咨询状态,就是相对应的回复状态
            CodeNamePairHelper.GetList("MKT", "ReplyStatus", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comConsultStatus.ItemsSource      = args.Result;
                comConsultStatusReply.ItemsSource = args.Result;//.Remove(;需要删除已经回复,需要确认
            });

            //标记类型,也就是咨询的类型
            CodeNamePairHelper.GetList("MKT", "ConsultCategory", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comConsultCategory.ItemsSource = args.Result;
            });
            //顾客类型
            CodeNamePairHelper.GetList("MKT", "CustomerCategory", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comCustomerCategory.ItemsSource      = args.Result;
                comCustomerCategoryReply.ItemsSource = args.Result;
            });
            #endregion

            #region 回复
            comIsTopReply.ItemsSource         = EnumConverter.GetKeyValuePairs <YNStatus>(EnumConverter.EnumAppendItemType.All);
            comProductStatusReply.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All);

            comIsType.ItemsSource = EnumConverter.GetKeyValuePairs <ReplyVendor>(EnumConverter.EnumAppendItemType.All);
            #endregion

            ProductConsultLayout.DataContext = model;
            btnStackPanel.DataContext        = model;

            ProductConsultReplyLayout.DataContext = modelReply;
            btnReplyStackPanel.DataContext        = modelReply;
            base.OnPageLoad(sender, e);
        }
        /// <summary>
        /// 绑定DropDownList数据:
        /// </summary>
        private void BindComboBoxData()
        {
            //排序:
            CodeNamePairHelper.GetList("Inventory", "ProductCenterSortByField", (objj, argss) =>
            {
                if (argss.FaultsHandle())
                {
                    return;
                }
                this.cmbOrderBy.ItemsSource = argss.Result;

                Dictionary <string, string> defaultCompareOperatorType1 = new Dictionary <string, string>();
                defaultCompareOperatorType1.Add("<=", "<=");
                defaultCompareOperatorType1.Add("=", "=");
                defaultCompareOperatorType1.Add(">=", ">=");
                Dictionary <string, string> defaultCompareOperatorType2 = new Dictionary <string, string>();
                defaultCompareOperatorType2.Add("=", "=");
                defaultCompareOperatorType2.Add("<>", "<>");

                #region [绑定比较操作符:]

                this.cmbStatusCompare.ItemsSource   = defaultCompareOperatorType2;
                this.cmbStatusCompare.SelectedIndex = 0;

                this.cmbSalesDayCompare.ItemsSource            = defaultCompareOperatorType1;
                this.cmbSalesDayCompare.SelectedIndex          = 0;
                this.cmbAvailableSaleDaysCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbAvailableSaleDaysCompare.SelectedIndex = 0;
                this.cmbRecommendStcokQty.ItemsSource          = defaultCompareOperatorType1;
                this.cmbRecommendStcokQty.SelectedIndex        = 0;

                this.cmbFinanceQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbFinanceQtyCompare.SelectedIndex = 0;

                this.cmbAvailbleQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbAvailbleQtyCompare.SelectedIndex = 0;

                this.cmbOrderedQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbOrderedQtyCompare.SelectedIndex = 0;

                this.cmbSubStockQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbSubStockQtyCompare.SelectedIndex = 0;

                this.cmbSettleQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbSettleQtyCompare.SelectedIndex = 0;

                this.cmbCurrentQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbCurrentQtyCompare.SelectedIndex = 0;

                this.cmbOnlineQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbOnlineQtyCompare.SelectedIndex = 0;

                this.cmbVirtualQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbVirtualQtyCompare.SelectedIndex = 0;

                this.cmbPurchaseQtyCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbPurchaseQtyCompare.SelectedIndex = 0;

                this.cmbAverageUnitCostCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbAverageUnitCostCompare.SelectedIndex = 0;

                this.cmbPriceCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbPriceCompare.SelectedIndex = 0;

                this.cmbPointCompare.ItemsSource   = defaultCompareOperatorType1;
                this.cmbPointCompare.SelectedIndex = 0;

                if (SetCompareDefaultValueHandler != null)
                {
                    SetCompareDefaultValueHandler(cmbAvailableSaleDaysCompare, cmbSalesDayCompare);
                }

                #endregion

                //***商品基本信息:
                //商品类型:
                this.cmbProductType.ItemsSource   = EnumConverter.GetKeyValuePairs <ProductType>();
                this.cmbProductType.SelectedIndex = 0;

                //分仓:
                CodeNamePairHelper.GetList("Inventory", "StockInfo", (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    this.cmbStock.ItemsSource   = args.Result.Where(x => x.Code != "59").ToList();
                    this.cmbStock.SelectedIndex = 0;

                    //用于加载完数据,设置默认值
                    if (SetStockDefaultValueHandler != null)
                    {
                        SetStockDefaultValueHandler(cmbStock);
                    }
                });
                //备货天数:
                CodeNamePairHelper.GetList("Inventory", "StockDay", (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    this.cmbStockDay.ItemsSource   = args.Result;
                    this.cmbStockDay.SelectedIndex = 0;
                });
                //代销属性:
                CodeNamePairHelper.GetList("Inventory", "ProductConsignFlag", (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    this.cmbConsign.ItemsSource   = args.Result;
                    this.cmbConsign.SelectedIndex = 0;
                });
                //状态:
                this.cmbStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ProductStatus>(ECCentral.Portal.Basic.Utilities.EnumConverter.EnumAppendItemType.All);

                //****库存:
                this.cmbIsSync.ItemsSource    = EnumConverter.GetKeyValuePairs <YNStatus>(ECCentral.Portal.Basic.Utilities.EnumConverter.EnumAppendItemType.All);
                this.cmbIsSync.SelectedIndex  = 0;
                this.cmbIsLarge.ItemsSource   = EnumConverter.GetKeyValuePairs <YNStatus>(ECCentral.Portal.Basic.Utilities.EnumConverter.EnumAppendItemType.All);
                this.cmbIsLarge.SelectedIndex = 0;
            });
        }
        public override void OnPageLoad(object sender, EventArgs e)
        {
            facade                 = new ProductReviewQueryFacade(this);
            filter                 = new ProductReviewQueryFilter();
            filterReply            = new ProductReviewReplyQueryFilter();
            model                  = new ProductReviewQueryVM();
            modelReply             = new ProductReviewReplyQueryVM();
            modelReply.ChannelID   = "1";
            model.ChannelID        = "1";
            model.CompanyCode      = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            modelReply.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            //商品状态
            comProductStatus.ItemsSource      = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All);
            comReplyProductStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All);

            List <KeyValuePair <YNStatus?, string> > ynSource = EnumConverter.GetKeyValuePairs <YNStatus>(EnumConverter.EnumAppendItemType.All);

            //List<KeyValuePair<NYNStatus?, string>> nynSource = EnumConverter.GetKeyValuePairs<NYNStatus>(EnumConverter.EnumAppendItemType.All);
            //首页热评
            comIndexHotReview.ItemsSource = ynSource;
            //首页服务热评
            comIndexServiceHotReview.ItemsSource = ynSource;
            //是否精华
            comEssence.ItemsSource = ynSource;
            //是否置顶
            comIsTop.ItemsSource = ynSource;
            //置底
            comIsBottom.ItemsSource = ynSource;
            //是否有用候选
            comUseful.ItemsSource = ynSource;
            //是否有用候选
            comIsCandidate.ItemsSource = ynSource;
            //CS处理状态,
            comCSProcessStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ReviewProcessStatus>(EnumConverter.EnumAppendItemType.All);
            //评论状态,就是相对应的回复状态
            CodeNamePairHelper.GetList("MKT", "ReplyStatus", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comReviewStatus.ItemsSource      = args.Result;
                comReplyReviewStatus.ItemsSource = args.Result;
            });
            CodeNamePairHelper.GetList("MKT", "Scores", (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comScores.ItemsSource   = args.Result;
                comScores.SelectedIndex = 0;
            });
            //顾客类型
            CodeNamePairHelper.GetList("MKT", "CustomerCategory", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comCustomerCategory.ItemsSource      = args.Result;
                comReplyCustomerCategory.ItemsSource = args.Result;
            });

            //回复类型
            CodeNamePairHelper.GetList("MKT", "ReplySource", CodeNamePairAppendItemType.All, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comReplyStatus.ItemsSource = args.Result;
            });

            //评论类型 普通/晒单
            List <KeyValuePair <ReviewType?, string> > reviewOperate = EnumConverter.GetKeyValuePairs <ReviewType>(EnumConverter.EnumAppendItemType.All);

            comReviewType.ItemsSource = reviewOperate;

            List <CodeNamePair> operate = new List <CodeNamePair>();

            operate.Add(new CodeNamePair()
            {
                Code = "0", Name = ResComment.Option_ALL
            });
            operate.Add(new CodeNamePair()
            {
                Code = ">", Name = ">"
            });
            operate.Add(new CodeNamePair()
            {
                Code = ">=", Name = ">="
            });
            operate.Add(new CodeNamePair()
            {
                Code = "=", Name = "="
            });
            operate.Add(new CodeNamePair()
            {
                Code = "<", Name = "<"
            });
            operate.Add(new CodeNamePair()
            {
                Code = "<=", Name = "<="
            });
            comOperation.ItemsSource = operate;

            productReviewBaseInfo.DataContext = model;
            btnStackPanel.DataContext         = model;
            productReviewReply.DataContext    = modelReply;
            btnReplyStackPanel.DataContext    = modelReply;

            SearchResult.DataContext  = model;
            SearchResult2.DataContext = modelReply;
            base.OnPageLoad(sender, e);
            comOperation.SelectedIndex = 0;
        }