示例#1
0
        private void BindData()
        {
            int categoryId   = Convert.ToInt32(this.cboCategories.SelectedValue, CultureInfo.InvariantCulture);
            int authorUserId = -1;

            if (!this.IsAdmin)
            {
                authorUserId = this.UserId;
            }

            string articleSearch = string.Empty;

            if (this.txtArticleSearch.Text.Trim() != string.Empty)
            {
                var objSecurity = new PortalSecurity();
                articleSearch = objSecurity.InputFilter(this.txtArticleSearch.Text.Trim(), PortalSecurity.FilterFlag.NoSQL);
            }

            DataSet ds = DataProvider.Instance().GetAdminCommentListing(
                categoryId, Convert.ToInt32(this.cboWorkflow.SelectedValue, CultureInfo.InvariantCulture), this.PortalId, authorUserId, articleSearch);

            if (ds.Tables[0].Rows.Count == 0)
            {
                this.lblMessage.Text    = Localization.GetString("NoCommentsFound", this.LocalResourceFile) + " " + this.cboCategories.SelectedItem;
                this.dgItems.Visible    = false;
                this.lblMessage.Visible = true;
            }
            else
            {
                DataView dv = ds.Tables[0].DefaultView;
                dv.Sort = "CreatedDate desc";
                this.dgItems.DataSource = dv;
                this.dgItems.DataBind();

                this.dgItems.Visible    = true;
                this.lblMessage.Visible = false;
            }
        }
示例#2
0
        private void FillDropDown()
        {
            ItemRelationship.DisplayCategoryHierarchy(this.cboCategories, -1, this.PortalId, false);

            var li = new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), "-1");

            this.cboCategories.Items.Insert(0, li);

            li = this.cboCategories.Items.FindByValue(this.CategoryId.ToString(CultureInfo.InvariantCulture));
            if (li != null)
            {
                li.Selected = true;
            }

            this.cboWorkflow.DataSource     = DataProvider.Instance().GetApprovalStatusTypes(this.PortalId);
            this.cboWorkflow.DataValueField = "ApprovalStatusID";
            this.cboWorkflow.DataTextField  = "ApprovalStatusName";
            this.cboWorkflow.DataBind();
            li = this.cboWorkflow.Items.FindByText(ApprovalStatus.Waiting.Name);
            if (li != null)
            {
                li.Selected = true;
            }
        }