Пример #1
0
        public virtual QueryResult QueryDefaultKeywords(DefaultKeywordsQueryFilter filter)
        {
            int totalCount;
            var dataTable = ObjectFactory <IDefaultKeywordsQueryDA> .Instance.QueryDefaultKeywords(filter, out totalCount);

            //根据PageType获取对应的名称
            string colName = "PageTypeName";

            dataTable.Columns.Add(colName, typeof(String));
            var codeNamePairs = ObjectFactory <PageTypeAppService> .Instance.GetPageType(filter.CompanyCode, filter.ChannelID, ModuleType.DefaultKeywords);

            foreach (DataRow row in dataTable.Rows)
            {
                var found = codeNamePairs.SingleOrDefault(item => item.Code == row["PageType"].ToString());
                if (found != null)
                {
                    row[colName] = found.Name;
                }
            }
            return(new QueryResult()
            {
                Data = dataTable,
                TotalCount = totalCount
            });
        }
Пример #2
0
        /// <summary>
        /// 查询默认关键字
        /// </summary>
        /// <param name="callback"></param>
        public void QueryDefaultKeywords(DefaultKeywordsQueryFilter 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/KeywordsInfo/QueryDefaultKeywords";

            restClient.QueryDynamicData(relativeUrl, filter, callback);
        }
Пример #3
0
 private void Button_Search_Click(object sender, RoutedEventArgs e)
 {
     if (ValidationManager.Validate(this.QuerySection))
     {
         filter          = model.ConvertVM <DefaultKeywordsQueryVM, DefaultKeywordsQueryFilter>();
         filter.PageType = ucPageType.PageType;
         filter.PageID   = ucPageType.PageID;
         filterVM        = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <DefaultKeywordsQueryFilter>(filter);
         QueryResultGrid.QueryCriteria = this.filter;
         QueryResultGrid.Bind();
     }
 }
Пример #4
0
 private void OnMaintainDialogResult(object sender, ResultEventArgs args)
 {
     if (args.DialogResult == DialogResultType.OK)
     {
         filter          = model.ConvertVM <DefaultKeywordsQueryVM, DefaultKeywordsQueryFilter>();
         filter.PageType = ucPageType.PageType;
         filter.PageID   = ucPageType.PageID;
         filterVM        = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <DefaultKeywordsQueryFilter>(filter);
         QueryResultGrid.QueryCriteria = this.filter;
         QueryResultGrid.Bind();
     }
 }
Пример #5
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            comStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ADStatus>(EnumConverter.EnumAppendItemType.All);

            facade                   = new DefaultKeywordsQueryFacade(this);
            filter                   = new DefaultKeywordsQueryFilter();
            model                    = new DefaultKeywordsQueryVM();
            model.CompanyCode        = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            QuerySection.DataContext = model;
            //默认选第一个渠道
            this.lstChannel.SelectedIndex = 0;
        }
Пример #6
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(ResKeywords.Information_ExportFailed);
                return;
            }
            ColumnSet col = new ColumnSet(this.QueryResultGrid);

            filter          = model.ConvertVM <DefaultKeywordsQueryVM, DefaultKeywordsQueryFilter>();
            filter.PageInfo = new ECCentral.QueryFilter.Common.PagingInfo()
            {
                PageSize  = ConstValue.MaxRowCountLimit,
                PageIndex = 0,
                SortBy    = string.Empty
            };
            facade.ExportExcelFile(filterVM, new ColumnSet[] { col });
        }
Пример #7
0
        /// <summary>
        /// 查询默认关键字
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public DataTable QueryDefaultKeywords(DefaultKeywordsQueryFilter 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("Keyword_QueryDefaultKeywordsList");

            using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, pagingEntity, "TransactionNumber DESC"))
            {
                //TODO:添加渠道查询条件
                //sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "ChannelID", DbType.String, "@ChannelID", QueryConditionOperatorType.Equal, filter.ChannelID);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "DefaultKeyword", DbType.String, "@DefaultKeyword", QueryConditionOperatorType.Like, filter.Keywords);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "PageType", DbType.Int32, "@PageType", QueryConditionOperatorType.Equal, filter.PageType);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "PageID", DbType.Int32, "@PageID", QueryConditionOperatorType.Equal, filter.PageID);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.AnsiStringFixedLength, "@Status", QueryConditionOperatorType.Equal, filter.Status);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CompanyCode", DbType.String, "@CompanyCode", QueryConditionOperatorType.Equal, filter.CompanyCode);
                sqlBuilder.ConditionConstructor.AddBetweenCondition(QueryConditionRelationType.AND, "BeginDate", DbType.DateTime, "@BeginDate",
                                                                    QueryConditionOperatorType.MoreThanOrEqual, QueryConditionOperatorType.LessThan, filter.BeginDateFrom, filter.BeginDateTo);

                sqlBuilder.ConditionConstructor.AddBetweenCondition(QueryConditionRelationType.AND, "EndDate", DbType.DateTime, "@EndDate",
                                                                    QueryConditionOperatorType.MoreThanOrEqual, QueryConditionOperatorType.LessThan, filter.EndDateFrom, filter.EndDateTo);


                cmd.CommandText = sqlBuilder.BuildQuerySql();
                var dt = cmd.ExecuteDataTable <ADStatus>("Status");
                totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
Пример #8
0
        public void ExportExcelFile(DefaultKeywordsQueryFilter filter, ColumnSet[] columns)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/QueryDefaultKeywords";

            restClient.ExportFile(relativeUrl, filter, columns);
        }