コード例 #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();
        }
コード例 #2
0
        public QueryResult QueryCustomerPointAddRequestItem(CustomerPointsAddRequestFilter request)
        {
            QueryResult returnResult = new QueryResult()
            {
                Data = ObjectFactory <ICustomerPointsAddRequestQueryDA> .Instance.QueryRequestItems(request)
            };

            return(returnResult);
        }
コード例 #3
0
        public virtual DataTable QueryRequestItems(CustomerPointsAddRequestFilter queryCriteria)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("SelectCustomerPointAddRequestItem");

            cmd.SetParameterValue("@PointAddRequestSysNo", queryCriteria.SystemNumber);
            cmd.SetParameterValue("@CompanyCode", queryCriteria.CompanyCode);
            cmd.SetParameterValue("@Status", "A");
            DataSet ds = cmd.ExecuteDataSet();

            return(ds.Tables[0]);
        }
コード例 #4
0
        public QueryResult QueryCustomerPointAddRequest(CustomerPointsAddRequestFilter request)
        {
            int         totalCount   = 0;
            QueryResult returnResult = new QueryResult()
            {
                Data = ObjectFactory <ICustomerPointsAddRequestQueryDA> .Instance.Query(request, out totalCount)
            };

            returnResult.TotalCount = totalCount;
            return(returnResult);
        }
コード例 #5
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);
            }
        }
コード例 #6
0
 private void DataGrid_Result_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
 {
     viewModel.NeweggAccountDesc   = this.Combo_Account.SelectedValue != null ? (this.Combo_Account.SelectedItem as dynamic).Name.ToString() : null;
     viewModel.OwnByDepartmentDesc = this.Combo_OwnByDepartment.SelectedValue != null ? (this.Combo_OwnByDepartment.SelectedItem as dynamic).Name.ToString() : null;
     viewModel.OwnByReasonDesc     = (this.Combo_Memo.SelectedIndex != 0 && this.Combo_Memo.SelectedIndex != -1) ? (this.Combo_Memo.SelectedItem as dynamic).Name.ToString() : null;
     queryRequest          = viewModel.ConvertVM <CustomerPointsAddQueryVM, CustomerPointsAddRequestFilter>();
     queryRequest.PageInfo = new PagingInfo()
     {
         PageIndex = e.PageIndex,
         PageSize  = e.PageSize,
         SortBy    = e.SortField
     };
     serviceFacade.QueryCustomerPointsAddList(queryRequest, (obj, args) =>
     {
         if (args.FaultsHandle())
         {
             return;
         }
         var customerPointsAddRequestList = args.Result.Rows;
         int totalCount              = args.Result.TotalCount;
         QueryResultGrid.TotalCount  = totalCount;
         QueryResultGrid.ItemsSource = customerPointsAddRequestList;
     });
 }
コード例 #7
0
        //private void QueryResultGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        //{
        //    if (this.QueryResultGrid.SelectedItem != null)
        //    {
        //        this.btnAudit.IsEnabled = ((CustomerPointsAddRequestStatus)(this.QueryResultGrid.SelectedItem as dynamic).status == CustomerPointsAddRequestStatus.AuditWaiting);
        //    }
        //}

        private void QueryResultGrid_ExportAllClick(object sender, EventArgs e)
        {
            if (this.QueryResultGrid.ItemsSource == null)
            {
                Window.Alert(ResCustomerPointsAddRequest.Msg_NoData);
                return;
            }
            queryRequest          = viewModel.ConvertVM <CustomerPointsAddQueryVM, CustomerPointsAddRequestFilter>();
            queryRequest.PageInfo = new PagingInfo()
            {
                PageIndex = 0,
                PageSize  = ConstValue.MaxRowCountLimit,
                SortBy    = string.Empty
            };
            ColumnSet col = new ColumnSet(this.QueryResultGrid);

            col.SetWidth("neweggaccount", 15);
            col.SetWidth("ownbydepartment", 15);
            col.SetWidth("point", 15);
            col.SetWidth("memo", 20);
            col.SetWidth("CreateDate", 20);
            col.SetWidth("confirmtime", 20);
            serviceFacade.ExportCustomerPointsAddList(queryRequest, new ColumnSet[] { col });
        }
コード例 #8
0
        public void QueryCustomerPointsAddItem(CustomerPointsAddRequestFilter request, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string itemRelativeUrl = "/CustomerService/Points/QueryPointsAddRequestItem";

            restClient.QueryDynamicData(itemRelativeUrl, request, callback);
        }
コード例 #9
0
        public void ExportCustomerPointsAddList(CustomerPointsAddRequestFilter request, ColumnSet[] columns)
        {
            string relativeUrl = "/CustomerService/Points/QueryPointsAddRequest";

            restClient.ExportFile(relativeUrl, request, columns);
        }
コード例 #10
0
        public virtual DataTable Query(CustomerPointsAddRequestFilter queryCriteria, out int totalCount)
        {
            totalCount = 0;
            CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("SelectCustomerPointAddRequest");

            PagingInfoEntity pagingInfo = BuildPagingInfoEntity(queryCriteria.PageInfo);

            using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(
                       cmd.CommandText, cmd, pagingInfo, "a.SysNo DESC"))
            {
                if (queryCriteria.SystemNumber.HasValue)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.SysNo",
                        DbType.Int32,
                        "@SysNo",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.SystemNumber);
                }
                else
                {
                    //创建时间开始
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND,
                                                                 "a.CreateTime", DbType.DateTime, "@CreateTimeFrom",
                                                                 QueryConditionOperatorType.MoreThanOrEqual,
                                                                 queryCriteria.CreateDateFrom);

                    //创建时间结束
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND,
                                                                 "a.CreateTime", DbType.DateTime, "@CreateTimeTo",
                                                                 QueryConditionOperatorType.LessThan,
                                                                 queryCriteria.CreateDateTo);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "b.CustomerID",
                        DbType.String,
                        "@CustomerID",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.CustomerID);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.SOSysNo",
                        DbType.Int32,
                        "@SOSysNo",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.SOSysNo);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.NewEggAccount",
                        DbType.String,
                        "@NewEggAccount",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.NeweggAccountDesc);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.OwnByDepartment",
                        DbType.String,
                        "@OwnByDepartment",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.OwnByDepartmentDesc);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.memo",
                        DbType.String,
                        "@OwnByReason",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.OwnByReasonDesc);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.Status",
                        DbType.Int32,
                        "@Status",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.Status);

                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.CompanyCode",
                        DbType.AnsiStringFixedLength,
                        "@CompanyCode",
                        QueryConditionOperatorType.Equal,
                        queryCriteria.CompanyCode);
                }

                cmd.CommandText = sqlBuilder.BuildQuerySql();
                DataTable dt = cmd.ExecuteDataTable("status", typeof(CustomerPointsAddRequestStatus));

                totalCount = int.Parse(cmd.GetParameterValue("@TotalCount").ToString());
                return(dt);
            }
        }