コード例 #1
0
        public virtual QueryResult QueryPollList(PollQueryFilter filter)
        {
            int totalCount;
            var dataTable = ObjectFactory <IPollItemQueryDA> .Instance.QueryPollList(filter, out totalCount);

            return(new QueryResult()
            {
                Data = dataTable,
                TotalCount = totalCount
            });
        }
コード例 #2
0
ファイル: PollFacade.cs プロジェクト: sanlonezhang/ql
        /// <summary>
        /// 查询投票主题
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="callback"></param>
        public void QueryPollList(PollQueryFilter filter, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            filter.PageInfo = new ECCentral.QueryFilter.Common.PagingInfo()
            {
                PageSize  = PageSize,
                PageIndex = PageIndex,
                SortBy    = SortField
            };
            string relativeUrl = "/MKTService/PollInfo/QueryPollList";

            restClient.QueryDynamicData(relativeUrl, filter, callback);
        }
コード例 #3
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     model                     = new PollListQueryVM();
     model.ChannelID           = "1";
     filter                    = new PollQueryFilter();
     model.CompanyCode         = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
     facade                    = new PollFacade(this);
     cbUserDefined.ItemsSource = EnumConverter.GetKeyValuePairs <YNStatus>(EnumConverter.EnumAppendItemType.All);
     comStatus.ItemsSource     = EnumConverter.GetKeyValuePairs <ADStatus>(EnumConverter.EnumAppendItemType.All);
     QuerySection.DataContext  = model;
     base.OnPageLoad(sender, e);
 }
コード例 #4
0
 private void Button_Search_Click(object sender, RoutedEventArgs e)
 {
     if (ValidationManager.Validate(this.QuerySection))
     {
         //if (ucPageType.PageType.HasValue && ucPageType.PageType.Value > 0 && ucPageType.PageType.Value <= 3 && !ucPageType.PageID.HasValue)
         //    Window.Alert(ResComment.Information_PageIDIsNotNull, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning);
         //else
         //{
         filter          = model.ConvertVM <PollListQueryVM, PollQueryFilter>();
         filter.PageType = ucPageType.PageType;
         filter.PageID   = ucPageType.PageID;
         filterVM        = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <PollQueryFilter>(filter);
         QueryResultGrid.QueryCriteria = this.filter;
         QueryResultGrid.Bind();
         //}
     }
 }
コード例 #5
0
        /// <summary>
        /// 数据全部导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void QueryResultGrid_ExportAllClick(object sender, EventArgs e)
        {
            if (filterVM == null || this.QueryResultGrid.TotalCount < 1)
            {
                Window.Alert(ResComment.Information_ExportFailed);
                return;
            }
            ColumnSet col = new ColumnSet(this.QueryResultGrid);

            filter          = model.ConvertVM <PollListQueryVM, PollQueryFilter>();
            filter.PageInfo = new ECCentral.QueryFilter.Common.PagingInfo()
            {
                PageSize  = ConstValue.MaxRowCountLimit,
                PageIndex = 0,
                SortBy    = string.Empty
            };
            facade.ExportExcelFile(filterVM, new ColumnSet[] { col });
        }
コード例 #6
0
ファイル: PollFacade.cs プロジェクト: sanlonezhang/ql
        public void ExportExcelFile(PollQueryFilter filter, ColumnSet[] columns)
        {
            string relativeUrl = "/MKTService/PollInfo/QueryPollList";

            restClient.ExportFile(relativeUrl, filter, columns);
        }
コード例 #7
0
        /// <summary>
        /// 查询投票列表
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public DataTable QueryPollList(PollQueryFilter filter, out int totalCount)
        {
            PagingInfoEntity pagingEntity = new PagingInfoEntity();

            if (filter.PageInfo == null)
            {
                pagingEntity = null;
            }
            else
            {
                pagingEntity.SortField     = filter.PageInfo.SortBy;
                pagingEntity.MaximumRows   = filter.PageInfo.PageSize;
                pagingEntity.StartRowIndex = filter.PageInfo.PageIndex * filter.PageInfo.PageSize;
            }
            var cmd = DataCommandManager.CreateCustomDataCommandFromConfig("Poll_QueryPollList");

            using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, pagingEntity, "P.SysNo DESC"))
            {
                //sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "ChannelID", DbType.String, "@ChannelID", QueryConditionOperatorType.Equal, filter.ChannelID);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "P.CompanyCode", DbType.String, "@CompanyCode", QueryConditionOperatorType.Equal, filter.CompanyCode);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "P.PageType", DbType.Int32, "@PageType", QueryConditionOperatorType.Equal, filter.PageType);
                if (filter.PageType.HasValue && filter.PageID.HasValue)
                {
                    if (filter.PageType == 2 && filter.PageID.Value > 0)
                    {
                        sqlBuilder.ConditionConstructor.AddCustomCondition(QueryConditionRelationType.AND, "P.PageID IN ( SELECT DISTINCT C2SysNo  FROM OverseaECommerceManagement.dbo.V_EM_EC_Category WHERE (C2SysNo IS NOT NULL OR C3SysNo IS NOT NULL) AND (C1SysNo =" + filter.PageID + " OR C2SysNo = " + filter.PageID + ") AND CompanyCode=" + filter.CompanyCode + "  )");
                    }

                    else if (filter.PageType == 3 && filter.PageID.Value > 0)
                    {
                        sqlBuilder.ConditionConstructor.AddCustomCondition(QueryConditionRelationType.AND, "P.PageID IN ( SELECT DISTINCT C3SysNo  FROM OverseaECommerceManagement.dbo.V_EM_EC_Category WHERE (C2SysNo IS NOT NULL OR C3SysNo IS NOT NULL) AND (C1SysNo =" + filter.PageID + " OR C2SysNo = " + filter.PageID + " OR C3SysNo = " + filter.PageID + ") AND CompanyCode=" + filter.CompanyCode + "  )");
                    }
                    else if (filter.PageID > 0)
                    {
                        sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "P.PageID", DbType.String, "@PageID", QueryConditionOperatorType.Equal, filter.PageID);
                    }
                }
                if (filter.UserDefined == YNStatus.Yes)
                {
                    sqlBuilder.ConditionConstructor.AddCustomCondition(QueryConditionRelationType.AND, "P.SysNo in (SELECT distinct PollSysno FROM OverseaECommerceManagement.dbo.Poll_ItemGroup with (nolock) WHERE CompanyCode=" + filter.CompanyCode + " AND Type = 'A')");
                }

                else if (filter.UserDefined == YNStatus.No)
                {
                    sqlBuilder.ConditionConstructor.AddCustomCondition(QueryConditionRelationType.AND, "P.SysNo not in (SELECT distinct PollSysno FROM OverseaECommerceManagement.dbo.Poll_ItemGroup with (nolock) WHERE CompanyCode=" + filter.CompanyCode + " AND Type = 'A')");
                }

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "P.Status", DbType.String, "@Status", QueryConditionOperatorType.Equal, filter.Status);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "P.PollName", DbType.String, "@PollName", QueryConditionOperatorType.Like, filter.PollName);


                cmd.CommandText = sqlBuilder.BuildQuerySql();
                EnumColumnList enumList = new EnumColumnList();
                enumList.Add("Status", typeof(ADStatus));
                enumList.Add("UserDefined", typeof(YNStatus));

                var dt = cmd.ExecuteDataTable(enumList);
                totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }