Пример #1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            serviceFacade            = new CustomerPointsAddQueryFacade(this);
            viewModel                = new CustomerPointsAddQueryVM();
            viewModel.HasExportRight = AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_PointAddRequest_Export);
            queryRequest             = new CustomerPointsAddRequestFilter();
            this.DataContext         = viewModel;
            int customerSysNo = 0;

            if (!string.IsNullOrEmpty(Request.Param) && int.TryParse(Request.Param, out customerSysNo))
            {
                TextBox_CustomerID.SetCustomerSysNo(customerSysNo);
            }
            base.OnPageLoad(sender, e);
            CodeNamePairHelper.GetList("Customer", "SystemAccount", (s, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                foreach (var item in arg.Result)
                {
                    viewModel.sysAccountList.Add(new CodeNamePair()
                    {
                        Code = item.Code, Name = item.Name
                    });
                }
                viewModel.sysAccountList.Insert(0, new CodeNamePair()
                {
                    Name = ResCommonEnum.Enum_All
                });
                Combo_Account.SelectedIndex = 0;
            });
            CheckRights();
        }
 public CustomerPointsAddRequestNew(int?customerSysNo)
 {
     InitializeComponent();
     serviceFacade       = new CustomerPointsAddQueryFacade();
     queryCustomerFacade = new ECCentral.Portal.UI.Customer.Facades.CustomerFacade();
     viewModel           = new CustomerPointsAddVM();
     this.DataContext    = viewModel;
     LoadSysAccountComboBoxData();
     validationListForSoSysNo   = new List <ValidationEntity>();
     validationListForProductID = new List <ValidationEntity>();
     if (customerSysNo != null)
     {
         TextBox_CustomerID.SetCustomerSysNo(customerSysNo.Value);
     }
 }
Пример #3
0
        public CustomerPointsAddRequestDetailInfo(DynamicXml model, string type)
        {
            viewModel     = new DynamicXml();
            serviceFacade = new CustomerPointsAddQueryFacade();
            actionRequest = new CustomerPointsAddRequest();
            queryRequest  = new CustomerPointsAddRequestFilter()
            {
                PageInfo    = new QueryFilter.Common.PagingInfo(),
                CompanyCode = CPApplication.Current.CompanyCode
            };

            if (null != model)
            {
                viewModel = model;
                if (!string.IsNullOrEmpty((string)viewModel["productID"]))
                {
                    (new OtherDomainQueryFacade()).QueryCategoryC1ByProductID((string)viewModel["productID"], (o, args) =>
                    {
                        if (!args.FaultsHandle())
                        {
                            viewModel["Category1Name"] = args.Result.CategoryName.Content;
                        }
                    });
                }
                this.DataContext = viewModel;
            }
            InitializeComponent();
            this.ProductsResultGrid.Bind();

            if (type == "Audit")
            {
                SwitchAuditButtons(true);
            }
            else
            {
                SwitchAuditButtons(false);
            }
        }