Example #1
0
        void UCStockSearch_Loaded(object sender, RoutedEventArgs e)
        {
            CommonDataFacade _facadeCommon = new CommonDataFacade(CPApplication.Current.CurrentPage);

            _facadeCommon.GetWebChannelList(true, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                this.cmbWebChannelList.ItemsSource   = args.Result;
                this.cmbWebChannelList.SelectedIndex = 0;
            });
        }
Example #2
0
        //绑定下拉框数据
        private void BindComboBoxData()    //未写完还有两个下拉框
        {
            //第三方订单
            m_commonFacade.GetWebChannelList(true, (sender, args) => {
                this.cmbWebChannelID.ItemsSource = args.Result;
            });

            CodeNamePairHelper.GetList(ConstValue.DomainName_SO
                                       , new string[] { ConstValue.Key_SOCreateResultType, ConstValue.Key_SOStatusSyncResultType }
                                       , CodeNamePairAppendItemType.All, (sender, e) =>
            {
                if (!e.FaultsHandle())
                {
                    this.cmbCreateResult.ItemsSource     = e.Result[ConstValue.Key_SOCreateResultType];
                    this.cmbStatusSyncResult.ItemsSource = e.Result[ConstValue.Key_SOStatusSyncResultType];
                }
            });
        }
Example #3
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);
                }
            }
        }
Example #4
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);
        }