Ejemplo n.º 1
0
        public void TestPerformQueryWithCustomFields()
        {
            List<QueryClause> clauses = new List<QueryClause>();

            QueryClause q = new QueryClause()
            {
                BooleanOperator = "AND",
                ComparisonOperator = "=",
                DataType = SqlDbType.Int,
                CustomFieldQuery = false,
                FieldName = "IssueStatusId",
                FieldValue = "16"

            };
            clauses.Add(q);

            q = new QueryClause()
            {
                BooleanOperator = "AND",
                ComparisonOperator = "=",
                DataType = SqlDbType.NVarChar,
                CustomFieldQuery = true,
                FieldName = "Browser",
                FieldValue = "2"

            };

            clauses.Add(q);

            List<Issue> results = IssueManager.PerformQuery(clauses, 95);

            foreach (Issue result in results)
                Console.WriteLine("Id: {1}; Title: {0}", result.Title, result.Id);

            Assert.IsTrue(results.Count > 0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the DayRender event of the prjCalendar control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.DayRenderEventArgs"/> instance containing the event data.</param>
        protected void prjCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
        {
            string onmouseoverStyle = "this.style.backgroundColor='#D4EDFF'";
            string onmouseoutStyle = "this.style.backgroundColor='@BackColor'";
            string rowBackColor = string.Empty;

            e.Cell.Attributes.Add("onmouseover", onmouseoverStyle);

            if (!e.Day.IsWeekend)
            {
                if (!e.Day.IsSelected)
                    e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor));
                else
                    e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", "#FFFFC1"));
            }
            else
                e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", "#F0F0F0"));

            if (e.Day.IsToday)
            {
                //TODO: If issues are due today in 7 days or less then create as red, else use blue?
            }

            List<QueryClause> queryClauses = new List<QueryClause>();
            switch (dropView.SelectedValue)
            {
                case "IssueDueDates":
                    QueryClause q = new QueryClause("AND", "IssueDueDate", "=", e.Day.Date.ToShortDateString(), SqlDbType.DateTime, false);
                    queryClauses.Add(q);

                    List<Issue> issues = IssueManager.PerformQuery(queryClauses, ProjectId);
                    foreach (Issue issue in issues)
                    {
                        if (issue.Visibility == (int)Globals.IssueVisibility.Private && issue.AssignedDisplayName != Security.GetUserName() && issue.CreatorDisplayName != Security.GetUserName() && (!UserManager.IsInRole(Globals.SUPER_USER_ROLE) || !UserManager.IsInRole(Globals.ProjectAdminRole)))
                            continue;

                        string cssClass = string.Empty;

                        if (issue.DueDate <= DateTime.Today)
                            cssClass = "calIssuePastDue";
                        else
                            cssClass = "calIssue";

                        if (issue.Visibility == (int)Globals.IssueVisibility.Private)
                            cssClass += " calIssuePrivate";

                        string title = string.Format(@"<div id=""issue"" class=""{3}""><a href=""../Issues/IssueDetail.aspx?id={2}"">{0} - {1}</a></div>", issue.FullId.ToUpper(), issue.Title, issue.Id,cssClass);
                        e.Cell.Controls.Add(new LiteralControl(title));
                    }
                    break;
                case "MilestoneDueDates":
                    List<Milestone> milestones = MilestoneManager.GetByProjectId(ProjectId).FindAll(m => m.DueDate == e.Day.Date);
                    foreach (Milestone m in milestones)
                    {
                        string cssClass = string.Empty;

                        if (m.DueDate <= DateTime.Today)
                            cssClass = "calIssuePastDue";
                        else
                            cssClass = "calIssue";

                        string projectName = ProjectManager.GetById(ProjectId).Name;
                        string title = string.Format(@"<div id=""issue"" class=""{4}""><a href=""../Issues/IssueList.aspx?pid={2}&m={3}"">{1} - {0} </a><br/>{5}</div>",m.Name,projectName,m.ProjectId,m.Id, cssClass,m.Notes);
                        e.Cell.Controls.Add(new LiteralControl(title));
                    }
                    break;

            }

            //Set the calendar to week mode only showing the selected week.
            if (dropCalendarView.SelectedValue == "Week")
            {
                if (Week(e.Day.Date) != Week(prjCalendar.VisibleDate))
                {
                    e.Cell.Visible = false;
                }
                e.Cell.Height = new Unit("300px");
            }
            else
            {
                //e.Cell.Height = new Unit("80px");
                //e.Cell.Width = new Unit("80px");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the DayRender event of the prjCalendar control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.DayRenderEventArgs"/> instance containing the event data.</param>
        protected void prjCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
        {
            if (e.Day.IsToday)
            {
                //TODO: If issues are due today in 7 days or less then create as red, else use blue?
            }
           
           
            List<QueryClause> queryClauses = new List<QueryClause>();
            switch (dropView.SelectedValue)
            {
                case "IssueDueDates":
                    QueryClause q = new QueryClause("AND", "iv.[IssueDueDate]", "=", e.Day.Date.ToShortDateString(), SqlDbType.DateTime);
                    queryClauses.Add(q);

                    q = new QueryClause("AND", "iv.[Disabled]", "=", "false", SqlDbType.Bit);
                    queryClauses.Add(q);

                    List<Issue> issues = IssueManager.PerformQuery(queryClauses, ProjectId);
                    foreach (Issue issue in issues)
                    {
                        if (issue.Visibility == (int)IssueVisibility.Private && issue.AssignedDisplayName != Security.GetUserName() && issue.CreatorDisplayName != Security.GetUserName() && (!UserManager.IsSuperUser() || !UserManager.IsInRole(issue.ProjectId, Globals.ProjectAdminRole)))
                            continue;

                        string cssClass = string.Empty;

                        if (issue.DueDate <= DateTime.Today)
                            cssClass = "calIssuePastDue";   
                        else
                            cssClass = "calIssue";

                        if (issue.Visibility == (int)IssueVisibility.Private)
                            cssClass += " calIssuePrivate";

                        string title = string.Format(@"<div id=""issue"" class=""{3}""><a href=""{4}{2}"">{0} - {1}</a></div>", issue.FullId.ToUpper(), issue.Title, issue.Id,cssClass, Page.ResolveUrl("~/Issues/IssueDetail.aspx?id="));
                        e.Cell.Controls.Add(new LiteralControl(title));
                    }
                    break;
                case "MilestoneDueDates":
                    List<Milestone> milestones = MilestoneManager.GetByProjectId(ProjectId).FindAll(m => m.DueDate == e.Day.Date);
                    foreach (Milestone m in milestones)
                    {
                        string cssClass = string.Empty;

                        if (m.DueDate <= DateTime.Today)
                            cssClass = "calIssuePastDue";
                        else
                            cssClass = "calIssue";

                        string projectName = ProjectManager.GetById(ProjectId).Name;
                        string title = string.Format(@"<div id=""issue"" class=""{4}""><a href=""{6}{2}&m={3}"">{1} - {0} </a><br/>{5}</div>", m.Name, projectName, m.ProjectId, m.Id, cssClass, m.Notes, Page.ResolveUrl("~/Issues/IssueDetail.aspx?pid="));
                        e.Cell.Controls.Add(new LiteralControl(title));
                    }
                    break;

            }
           

            //Set the calendar to week mode only showing the selected week.
            if (dropCalendarView.SelectedValue == "Week")
            {
                if (Week(e.Day.Date) != Week(prjCalendar.VisibleDate))
                { 
                    e.Cell.Visible = false;
                }
                e.Cell.Height = new Unit("300px"); 
            }
            else
            {
                //e.Cell.Height = new Unit("80px");
                //e.Cell.Width = new Unit("80px");
            }
               
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This method adds a new query clause to the user interface.
        /// </summary>
        /// <param name="bindData">if set to <c>true</c> [bind data].</param>
        /// <param name="queryClause"></param>
        void AddClause(bool bindData = false, QueryClause queryClause = null)
        {
            var ctlPickQueryField = (PickQueryField)Page.LoadControl("~/UserControls/PickQueryField.ascx");

            plhClauses.Controls.Add(ctlPickQueryField);
            ctlPickQueryField.ProjectId = ProjectId;
            if (bindData)
                ctlPickQueryField.QueryClause = queryClause;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Performs the issue search and populates mainIssues and mainComment.
        /// </summary>
        /// <param name="searchProjects">A List of projects to search through.</param>
        private void PerformIssueSearch(IEnumerable<Project> searchProjects)
        {
            var foundComments = new List<IssueComment>();
            var issueComments = new List<IssueComment>();
            var lstMainHistory = new List<IssueHistory>();

            // Our search strings on normal and "like" comparators
            // Note: these are deliberately not trimmed!
            // to the users, "test" might be different from "test "
            var strSearch = txtSearch.Text;
            var strLike = "%" + strSearch + "%";
            var strHtmlSearch = Server.HtmlEncode(strSearch);
            var strHtmlLike = "%" + strHtmlSearch + "%";

            // if the two strings are equal srchHtmlcode is false
            // If they are not equal, then I need to search for the HTML encoded
            // variants later on.
            var srchHtmlcode = strHtmlSearch != strSearch;

            var srchComments = chkComments.Checked;
            var srchOpenIssues = chkExcludeClosedIssues.Checked;
            var srchUserName = false;//= chkUsername.Checked ; // not implemented

            var srchHistory = false; //  chkHistory.Checked;

            // Sort the projects using LINQ
            foreach (var p in searchProjects)
            {
                // now search each project with wildcard parameters
                // (except for the search string)

                // ---------------------------------------------------------------
                // Normal Search
                //
                // Searches Description, Issue Title using a LIKE query
                // If you are searching username it adds the LastUpdateUsername,
                // AssignedUsername, CreatorUserName, OwnerUserName to the list.
                //
                // ---------------------------------------------------------------

                var queryClauses = new List<QueryClause>();

                // NOTE WE ARE OPENING A PARENTHISES using the
                // "William Highfield" trick ;)
                //
                // SQL Statement constructed by the QueryBuilder will nned to be something like
                // SELECT something FROM somewhere WHERE 1=1 AND ( IssueDescription LIKE '%test%' OR IssueTitle LIKE '%test%' )
                //
                // The parenthesis ensure this, however you need to close the parenthesis off properly.

                var q = new QueryClause("AND (", "IssueDescription", "LIKE", strLike, SqlDbType.NVarChar, false);
                queryClauses.Add(q);
                q = new QueryClause("OR", "IssueTitle", "LIKE", strLike, SqlDbType.NVarChar, false);
                queryClauses.Add(q);

                if (srchHtmlcode)
                {
                    q = new QueryClause("OR", "IssueDescription", "LIKE", strHtmlLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);
                    q = new QueryClause("OR", "IssueTitle", "LIKE", strHtmlLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);
                }

                // USERNAME
                if (srchUserName)
                {
                    /*
                     *
                    q = new QueryClause("OR", "LastUpdateUsername", "LIKE", strLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);

                    q = new QueryClause("OR", "AssignedUsername", "LIKE", strLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);

                    q = new QueryClause("OR", "CreatorUserName", "LIKE", strLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);

                    q = new QueryClause("OR", "OwnerUserName", "LIKE", strLike, SqlDbType.NVarChar, false);
                    queryClauses.Add(q);
                     *
                     */
                }

                // NOW TO CLOSE PARENTHISES
                //
                // Using the "William Highfield" trick ;)
                //

                q = new QueryClause(")", "", "", "", SqlDbType.NVarChar, false);
                queryClauses.Add(q);

                // Use the new Generic way to search with those QueryClauses
                var issues = IssueManager.PerformQuery(queryClauses, p.Id);

                // Now we can quicjkly filter out open issues
                if (srchOpenIssues)
                {
                    // get list of open issues for the project using LINQ
                    var tmpIssues = from iss in issues
                                    join st in StatusManager.GetByProjectId(p.Id)
                                    on iss.StatusId equals st.Id
                                    where st.IsClosedState == false
                                    select iss;

                    _mainIssues.AddRange(tmpIssues);
                }
                else
                {
                    _mainIssues.AddRange(issues);
                }

                //if (srchComments /*|| srchHistory*/ )
                //{
                //    // Get the Issues by Project now so
                //    // we dont have repeated fetches if the user
                //    // selects multiple options.

                //    // we need to search the projects again becuase bc only contains our search results
                //    Issues = Issue.GetByProjectId(p.Id);
                //}

                // ---------------------------------------------------------------
                // Search History
                //
                // ---------------------------------------------------------------
                // List<IssueHistory> lstprjHistory = null;
                if (srchHistory)
                {
                    /*
                    lstprjHistory = new List<IssueHistory>();
                    queryClauses.Clear();
                    // bug need highfield method
                    queryClauses.Add(new QueryClause("AND", "OldValue", "LIKE", strLike , SqlDbType.VarChar, false));
                    queryClauses.Add(new QueryClause("OR", "NewValue", "LIKE", strLike, SqlDbType.VarChar, false));
                    queryClauses.Add(new QueryClause("AND", "c.ProjectID", "=", p.Id.ToString(), SqlDbType.Int, false));
                    lstprjHistory = IssueHistory.PerformQuery(queryClauses);

                    // Now we can quicjkly filter out open issues
                    if (srchOpenIssues)
                    {

                        // get list of open issues with matching history items for the project using LINQ
                        var tmpIssues = from hist in lstprjHistory
                                        join iss1 in Issue.GetByProjectId(p.Id)
                                        on hist.Id equals iss1.Id
                                        join st in Status.GetByProjectId(p.Id)
                                        on iss1.StatusId equals st.Id
                                        where st.IsClosedState = false
                                        select iss1;

                        mainIssues.AddRange(tmpIssues);

                    }
                    else
                    {
                        mainIssues.AddRange(Issues);
                    }

                    throw new NotImplementedException();
                    */
                }

                // ---------------------------------------------------------------
                // Search Comments
                //
                // ---------------------------------------------------------------

                if (srchComments)
                {
                    issueComments.Clear();
                    foundComments.Clear();

                    // Get ALL issues
                    issues = IssueManager.GetByProjectId(p.Id);

                    // Now filter out the Closed issues if we need to
                    if (srchOpenIssues)
                    {
                        // get list of open issues with matching history items for the project using LINQ
                        var tmpIssues = from Iss in issues
                                        join st in StatusManager.GetByProjectId(p.Id)
                                        on Iss.StatusId equals st.Id
                                        where st.IsClosedState = false
                                        select Iss;

                        List<Issue> tmpIssueList = new List<Issue>();
                        tmpIssueList.AddRange(tmpIssues);

                        issues.Clear();
                        issues.AddRange(tmpIssueList);
                        // Issues now only has open issues
                    }

                    foreach (Issue iss in issues)
                    {
                        // New Way
                        // Using the Generic Interface
                        List<QueryClause> qryComment = new List<QueryClause>();

                        // NOTE WE ARE OPENING A PARENTHISES using the
                        // "William Highfield" trick ;)
                        // see earlier in this code

                        q = new QueryClause("AND (", "Comment", "LIKE", strLike, SqlDbType.VarChar, false);
                        qryComment.Add(q);

                        if (srchHtmlcode)
                        {
                            q = new QueryClause("OR", "Comment", "LIKE", strHtmlLike, SqlDbType.VarChar, false);
                            qryComment.Add(q);
                        }

                        // NOW TO CLOSE PARENTHISES
                        //
                        // Using the "William Highfield" trick ;)
                        //
                        q = new QueryClause(")", "", "", "", SqlDbType.NVarChar, false);
                        qryComment.Add(q);

                        //if (srchUserName)
                        //{
                        //    q = new QueryClause("OR", "CreatorUsername", "LIKE", "%" + strSearch + "%", SqlDbType.VarChar, false);
                        //    qryComment.Add(q);
                        //}

                        issueComments = IssueCommentManager.PerformQuery(iss.Id, qryComment);

                        // Did we find anything?
                        if (issueComments.Count > 0)
                        {
                            _mainComments.AddRange(issueComments);
                            _mainIssues.Add(iss);
                            // make sure we record the parent issue of the comment(s)
                        }
                    }
                }

                //if (srchHistory && (lstprjHistory != null))
                //{
                //   // lstMainHistory.AddRange(lstprjHistory);
                //}
            } // foreach project

            // ---------------------------------------------------------------
            // Clean up duplicates and sort
            //
            // mainIssues and mainComments
            // Sorry for the horrible variable names
            //
            // ---------------------------------------------------------------

            var tmpIss = (from iss1 in _mainIssues
                          orderby iss1.ProjectId, iss1.Id descending
                          select iss1).Distinct(new DistinctIssueComparer());

            List<Issue> tmpIssues1 = new List<Issue>();
            tmpIssues1.AddRange(tmpIss);
            _mainIssues.Clear();
            _mainIssues.AddRange(tmpIssues1);

            // mainIssues list should be pure now

            var tmpComm = (from comm in _mainComments
                           orderby comm.IssueId, comm.Id
                           select comm)
                           .Distinct();

            List<IssueComment> tmpComm1 = new List<IssueComment>();
            tmpComm1.AddRange(tmpComm);
            _mainComments.Clear();
            _mainComments.AddRange(tmpComm1);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Handles the Click event of the OkButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void OkButton_Click(object sender, EventArgs e)
        {
            int OldCategoryId = 0;
            if(!string.IsNullOrEmpty(HiddenField1.Value))
                OldCategoryId = Convert.ToInt32(HiddenField1.Value);

            if (OldCategoryId != 0)
            {
                List<QueryClause> queryClauses = new List<QueryClause>();
                QueryClause q = new QueryClause("AND", "IssueCategoryId", "=", HiddenField1.Value, SqlDbType.Int, false);
                queryClauses.Add(q);

                List<Issue> issues = IssueManager.PerformQuery(queryClauses, ProjectId);

                if (RadioButton1.Checked) //delete category
                {
                    //if (RecursiveDelete.Checked == true)
                    //Category.DeleteChildCategoriesByCategoryId(OldCategoryId);
                    //delete the category.
                    CategoryManager.Delete(OldCategoryId);
                }

                if (RadioButton2.Checked) //reassign issues to existing category.
                {
                    if (DropCategory.SelectedValue == 0)
                    {
                        Message1.ShowErrorMessage(GetLocalResourceObject("NoCategorySelected").ToString());
                        return;
                    }
                    if (OldCategoryId == DropCategory.SelectedValue)
                    {
                        Message1.ShowErrorMessage(GetLocalResourceObject("SameCategorySelected").ToString());
                        return;
                    }

                    foreach (Issue issue in issues)
                    {
                        issue.CategoryName = DropCategory.SelectedText;
                        issue.CategoryId = DropCategory.SelectedValue;
                        IssueManager.SaveOrUpdate(issue);
                    }

                    //delete the category.
                    CategoryManager.Delete(OldCategoryId);
                }

                //assign new category
                if (RadioButton3.Checked)
                {
                    if(string.IsNullOrEmpty(NewCategoryTextBox.Text))
                    {
                        Message1.ShowErrorMessage(GetLocalResourceObject("NewCategoryNotEntered").ToString());
                        return;
                    }
                    var c = new Category { ProjectId = ProjectId, ParentCategoryId = 0, Name = NewCategoryTextBox.Text, ChildCount = 0 };
                    CategoryManager.SaveOrUpdate(c);
                    foreach (var issue in issues)
                    {
                        issue.CategoryName = NewCategoryTextBox.Text;
                        issue.CategoryId = c.Id;
                        IssueManager.SaveOrUpdate(issue);
                    }
                    //delete the category.
                    CategoryManager.Delete(OldCategoryId);

                }
            }
            else
            {
                Message1.ShowErrorMessage(GetLocalResourceObject("CannotDeleteRootCategory").ToString());
                return;
            }
        }
Ejemplo n.º 7
0
        public object[] GetProjectIssues(int ProjectId, string Filter)
        {
            if (ProjectManager.GetById(ProjectId).AccessType == Globals.ProjectAccessType.Private && !ProjectManager.IsUserProjectMember(UserName, ProjectId))
                throw new UnauthorizedAccessException(string.Format(LoggingManager.GetErrorMessageResource("ProjectAccessDenied"), UserName));

            List<Issue> issues;
            QueryClause q;
            List<QueryClause> queryClauses = new List<QueryClause>();
            string BooleanOperator = "AND";

            if (Filter.Trim() == "")
            {
                // Return all Issues
                issues = IssueManager.GetByProjectId(ProjectId);
            }
            else
            {
                foreach (string item in Filter.Split('&'))
                {
                    if (item.StartsWith("status=", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (item.EndsWith("=notclosed", StringComparison.CurrentCultureIgnoreCase))
                        {
                            List<Status> status = StatusManager.GetByProjectId(ProjectId).FindAll(delegate(Status s) { return s.IsClosedState == true; });
                            foreach (Status st in status)
                            {
                                q = new QueryClause(BooleanOperator, "IssueStatusId", "<>", st.Id.ToString(), SqlDbType.Int, false);
                                queryClauses.Add(q);
                            }
                        }
                        else if (item.EndsWith("=new", StringComparison.CurrentCultureIgnoreCase))
                        {
                            q = new QueryClause(BooleanOperator, "AssignedUsername", "=", "none", SqlDbType.NVarChar, false);
                            queryClauses.Add(q);
                            List<Status> status = StatusManager.GetByProjectId(ProjectId).FindAll(delegate(Status s) { return s.IsClosedState == true; });
                            foreach (Status st in status)
                            {
                                q = new QueryClause(BooleanOperator, "IssueStatusId", "<>", st.Id.ToString(), SqlDbType.Int, false);
                                queryClauses.Add(q);
                            }
                        }
                    }
                    else if (item.StartsWith("owner=", StringComparison.CurrentCultureIgnoreCase))
                    {
                        q = new QueryClause(BooleanOperator, "OwnerUsername", "=", item.Substring(item.IndexOf('=') + 1, item.Length - item.IndexOf('=') - 1).ToString(), SqlDbType.NVarChar, false);
                        queryClauses.Add(q);
                    }
                    else if (item.StartsWith("reporter=", StringComparison.CurrentCultureIgnoreCase))
                    {
                        q = new QueryClause(BooleanOperator, "CreatorUsername", "=", item.Substring(item.IndexOf('=') + 1, item.Length - item.IndexOf('=') - 1).ToString(), SqlDbType.NVarChar, false);
                        queryClauses.Add(q);
                    }
                    else if (item.StartsWith("assigned=", StringComparison.CurrentCultureIgnoreCase))
                    {
                        q = new QueryClause(BooleanOperator, "AssignedUsername", "=", item.Substring(item.IndexOf('=') + 1, item.Length - item.IndexOf('=') - 1).ToString(), SqlDbType.NVarChar, false);
                        queryClauses.Add(q);
                    }
                }
                issues = IssueManager.PerformQuery(queryClauses, ProjectId);
            }

            List<Object> issueList = new List<Object>();
            Object[] issueitem;
            foreach (Issue item in issues)
            {
                issueitem = new Object[13];
                issueitem[0] = item.Id;
                issueitem[1] = item.DateCreated;
                issueitem[2] = item.LastUpdate;
                issueitem[3] = item.StatusName;
                issueitem[4] = item.Description;
                issueitem[5] = item.CreatorUserName;
                issueitem[6] = item.ResolutionName;
                issueitem[7] = item.CategoryName;
                issueitem[8] = item.Title;
                issueitem[9] = item.PriorityName;
                issueitem[10] = item.MilestoneName;
                issueitem[11] = item.OwnerUserName;
                issueitem[12] = item.IssueTypeName;
                issueList.Add(issueitem);
            }
            return issueList.ToArray();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Binds the issues.
        /// </summary>
        protected void BindIssues()
        {
            bool isError = false;
            List<Issue> colIssues = null;

            //only do this if the user came from the project summary page.
               //only do this if the user came from the project summary or default page.
               //if ((Request.UrlReferrer != null) &&
            //   (Request.UrlReferrer.ToString().Contains("ProjectSummary") || Request.UrlReferrer.ToString().Contains("Default") && Request.QueryString.Count > 1))
               //if (Request.UrlReferrer != null && Request.UrlReferrer.ToString().Contains("ProjectSummary") && Request.QueryString.Count > 1)

               //if ((Request.UrlReferrer != null) &&
              //(!Request.UrlReferrer.ToString().Contains("IssueList") && Request.QueryString.Count > 1 && dropView.SelectedIndex == 0))
               if (Request.QueryString.Count > 1 && dropView.SelectedIndex == 0)
               {
               dropView.SelectedIndex = 0;
               QueryClause q;
               bool isStatus = false;
               string BooleanOperator = "AND";
               List<QueryClause> queryClauses = new List<QueryClause>();
               if (!string.IsNullOrEmpty(IssueCategoryId))
               {
                   if (IssueCategoryId == "0")
                   {
                       q = new QueryClause(BooleanOperator, "IssueCategoryId", "IS", null, SqlDbType.Int, false);
                   }
                   else
                   {
                       q = new QueryClause(BooleanOperator, "IssueCategoryId", "=", IssueCategoryId.ToString(), SqlDbType.Int, false);
                   }
                   queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(IssueTypeId))
               {
                   q = new QueryClause(BooleanOperator, "IssueTypeId", "=", IssueTypeId.ToString(), SqlDbType.Int, false);
                   queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(IssueMilestoneId))
               {
                   //if zero, do a null comparison.
                   if (IssueMilestoneId == "0")
                   {
                       q = new QueryClause(BooleanOperator, "IssueMilestoneId", "IS", null, SqlDbType.Int, false);
                   }
                   else
                   {
                       q = new QueryClause(BooleanOperator, "IssueMilestoneId", "=", IssueMilestoneId, SqlDbType.Int, false);
                   }
                   queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(IssueResolutionId))
               {
                   q = new QueryClause(BooleanOperator, "IssueResolutionId", "=", IssueResolutionId.ToString(), SqlDbType.Int, false);
                   queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(IssuePriorityId))
               {
                   q = new QueryClause(BooleanOperator, "IssuePriorityId", "=", IssuePriorityId.ToString(), SqlDbType.Int, false);
                   queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(IssueStatusId))
               {
                   if (IssueStatusId != "-1")
                   {
                       isStatus = true;
                       q = new QueryClause(BooleanOperator, "IssueStatusId", "=", IssueStatusId.ToString(), SqlDbType.Int, false);
                       queryClauses.Add(q);
                   }
                   else
                   {
                       isStatus = true;
                       List<Status> closedStatus = StatusManager.GetByProjectId(ProjectId).FindAll(s => !s.IsClosedState);
                       foreach (Status status in closedStatus)
                           queryClauses.Add(new QueryClause("AND", "IssueStatusId", "<>", status.Id.ToString(), SqlDbType.Int, false));
                   }

                   //q = new QueryClause(BooleanOperator, "IssueStatusId", "=", IssueStatusId.ToString(), SqlDbType.Int, false);
                   //queryClauses.Add(q);
               }
               if (!string.IsNullOrEmpty(AssignedUserName))
               {
                   if (AssignedUserName == "0")
                       q = new QueryClause(BooleanOperator, "IssueAssignedUserId", "IS", null, SqlDbType.NVarChar, false);
                   else
                       q = new QueryClause(BooleanOperator, "AssignedUsername", "=", AssignedUserName, SqlDbType.NVarChar, false);

                   queryClauses.Add(q);
               }

               //exclude all closed status's
               if (!isStatus)
               {
                   List<Status> status = StatusManager.GetByProjectId(ProjectId).FindAll(delegate(Status s) { return s.IsClosedState == true; });
                   foreach (Status st in status)
                   {
                       q = new QueryClause(BooleanOperator, "IssueStatusId", "<>", st.Id.ToString(), SqlDbType.Int, false);
                       queryClauses.Add(q);
                   }
               }

               //q = new QueryClause(BooleanOperator, "new", "=", "another one", SqlDbType.NVarChar, true);
               //queryClauses.Add(q);
               try
               {
                   colIssues = IssueManager.PerformQuery(queryClauses, ProjectId);

                   // TODO: WARNING Potential Cross Site Scripting attack
                   // also this code only runs if the previous code does not freak out
                   ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?{0}&channel=7", Request.QueryString);
               }
               catch
               {
                   // BGN-1379
                   // This URL http://localhost/BugNET/Issues/IssueList.aspx?pid=96&c=4471%27;
                   // Generates a Input string was not in a correct format exception in
                   // Source File:  C:\Development\BugNET 0.7.921 SVN Source\branches\BugNET 0.8\src\BugNET_WAP\Old_App_Code\DAL\SqlDataProvider.cs    Line:  4932
                   // Line 4932:                gcfr(sqlCmd.ExecuteReader(), ref List);
                   isError = true;

                   // perhaps this should rather ErrorRedirector.TransferToErrorPage(Page);
                   // but an empty grid with "There are no issues that match your criteria." looks
                   // nice too
               }
               }
               else
               {

               switch (dropView.SelectedValue)
               {
                   case "Relevant":
                       colIssues = IssueManager.GetByRelevancy(ProjectId, User.Identity.Name);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=8", ProjectId);
                       break;
                   case "Assigned":
                       colIssues = IssueManager.GetByAssignedUserName(ProjectId, User.Identity.Name);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=9", ProjectId);
                       break;
                   case "Owned":
                       colIssues = IssueManager.GetByOwnerUserName(ProjectId, User.Identity.Name);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=10", ProjectId);
                       break;
                   case "Created":
                       colIssues = IssueManager.GetByCreatorUserName(ProjectId, User.Identity.Name);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=11", ProjectId);
                       break;
                   case "All":
                       colIssues = IssueManager.GetByProjectId(ProjectId);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=12", ProjectId);
                       break;
                   case "Open":
                       colIssues = IssueManager.GetOpenIssues(ProjectId);
                       ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=14", ProjectId);
                       break;
                   default:
                       colIssues = new List<Issue>();
                       break;
               }
               }

               if (!isError)
               {

               ctlDisplayIssues.DataSource = colIssues;

               if (Request.QueryString["cr"] != null)
                   colIssues.Sort(new IssueComparer("Created", true));

               if (Request.QueryString["ur"] != null)
                   colIssues.Sort(new IssueComparer("LastUpdate", true));

               ctlDisplayIssues.DataBind();
               }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Filtereds the issues feed.
        /// </summary>
        /// <param name="feed">The feed.</param>
        private void FilteredIssuesFeed(ref SyndicationFeed feed)
        {
            var queryClauses = new List<QueryClause>();

            var isStatus = false;

            // add the disabled field as the first order of business
            var q = new QueryClause("AND", "iv.[Disabled]", "=", "0", SqlDbType.Int);
            queryClauses.Add(q);

            if (!string.IsNullOrEmpty(IssueCategoryId))
            {
                q = IssueCategoryId == "0" ?
                    new QueryClause("AND", "iv.[IssueCategoryId]", "IS", null, SqlDbType.Int) :
                    new QueryClause("AND", "iv.[IssueCategoryId]", "=", IssueCategoryId, SqlDbType.Int);

                queryClauses.Add(q);
            }

            if (!string.IsNullOrEmpty(IssueTypeId))
            {
                q = IssueTypeId == "0" ?
                    new QueryClause("AND", "iv.[IssueTypeId]", "IS", null, SqlDbType.Int) :
                    new QueryClause("AND", "iv.[IssueTypeId]", "=", IssueTypeId, SqlDbType.Int);

                queryClauses.Add(q);
            }

            if (!string.IsNullOrEmpty(IssuePriorityId))
            {
                q = IssuePriorityId == "0" ?
                    new QueryClause("AND", "iv.[IssuePriorityId]", "IS", null, SqlDbType.Int) :
                    new QueryClause("AND", "iv.[IssuePriorityId]", "=", IssuePriorityId, SqlDbType.Int);

                queryClauses.Add(q);
            }

            if (!string.IsNullOrEmpty(IssueMilestoneId))
            {
                q = IssueMilestoneId == "0" ?
                    new QueryClause("AND", "iv.[IssueMilestoneId]", "IS", null, SqlDbType.Int) :
                    new QueryClause("AND", "iv.[IssueMilestoneId]", "=", IssueMilestoneId, SqlDbType.Int);

                queryClauses.Add(q);
            }

            if (!string.IsNullOrEmpty(IssueResolutionId))
            {
                q = IssueResolutionId == "0" ?
                    new QueryClause("AND", "iv.[IssueResolutionId]", "IS", null, SqlDbType.Int) :
                    new QueryClause("AND", "iv.[IssueResolutionId]", "=", IssueResolutionId, SqlDbType.Int);

                queryClauses.Add(q);
            }

            if (!string.IsNullOrEmpty(AssignedUserName))
            {
                queryClauses.Add(new QueryClause("AND", "iv.[AssignedUserName]", "=", AssignedUserName, SqlDbType.NVarChar));
            }

            if (!string.IsNullOrEmpty(OwnerUserName))
            {
                queryClauses.Add(new QueryClause("AND", "iv.[OwnerUserName]", "=", OwnerUserName, SqlDbType.NVarChar));
            }

            if (!string.IsNullOrEmpty(IssueStatusId))
            {
                if (IssueStatusId != "-1")
                {
                    isStatus = true;

                    q = IssueStatusId == "0" ?
                        new QueryClause("AND", "iv.[IssueStatusId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssueStatusId]", "=", IssueStatusId, SqlDbType.Int);

                    queryClauses.Add(q);
                }
                else
                {
                    isStatus = true;
                    queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                }
            }

            // exclude all closed status's
            if (!isStatus || ExcludeClosedIssues)
            {
                queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
            }

            var issueList = IssueManager.PerformQuery(queryClauses, null, _projectId);


            var feedItems = CreateSyndicationItemsFromIssueList(issueList);
            string title;
            if (_projectId > 0)
            {
                var p = ProjectManager.GetById(_projectId);
                title = p.Name;
            }
            else
            {
                title = Security.GetDisplayName();
            }

            feed.Title =
                SyndicationContent.CreatePlaintextContent(
                    string.Format(GetLocalResourceObject("FilteredIssuesTitle").ToString(), title));
            feed.Description =
                SyndicationContent.CreatePlaintextContent(
                    string.Format(GetLocalResourceObject("FilteredIssuesDescription").ToString(), title));
            feed.Items = feedItems;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Binds the issues.
        /// </summary>
        private void BindIssues(string issueViewSelectedValue = "")
        {
            var isError = false;

            var queryClauses = new List<QueryClause>();

            // add the disabled field as the first order of business
            var q = new QueryClause("AND", "iv.[Disabled]", "=", "0", SqlDbType.Int);
            queryClauses.Add(q);

            if (Request.QueryString.Count > 1 && issueViewSelectedValue.Equals(""))
            {
                dropView.SelectedIndex = 0;
                var isStatus = false;

                if (!string.IsNullOrEmpty(IssueCategoryId))
                {
                    q = IssueCategoryId == "0" ?
                        new QueryClause("AND", "iv.[IssueCategoryId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssueCategoryId]", "=", IssueCategoryId, SqlDbType.Int);

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(IssueTypeId))
                {
                    q = IssueTypeId == "0" ?
                        new QueryClause("AND", "iv.[IssueTypeId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssueTypeId]", "=", IssueTypeId, SqlDbType.Int);

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(IssuePriorityId))
                {
                    q = IssuePriorityId == "0" ?
                        new QueryClause("AND", "iv.[IssuePriorityId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssuePriorityId]", "=", IssuePriorityId, SqlDbType.Int);

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(IssueMilestoneId))
                {
                    q = IssueMilestoneId == "0" ?
                        new QueryClause("AND", "iv.[IssueMilestoneId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssueMilestoneId]", "=", IssueMilestoneId, SqlDbType.Int);

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(IssueResolutionId))
                {
                    q = IssueResolutionId == "0" ?
                        new QueryClause("AND", "iv.[IssueResolutionId]", "IS", null, SqlDbType.Int) :
                        new QueryClause("AND", "iv.[IssueResolutionId]", "=", IssueResolutionId, SqlDbType.Int);

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(AssignedUserId))
                {
                    Guid userId;
                    q = new QueryClause("AND", "iv.[IssueAssignedUserId]", "IS", null, SqlDbType.NVarChar);

                    if (Guid.TryParse(AssignedUserId, out userId))
                    {
                        q = AssignedUserId == Globals.EMPTY_GUID ?
                            new QueryClause("AND", "iv.[IssueAssignedUserId]", "IS", null, SqlDbType.Int) :
                            new QueryClause("AND", "iv.[IssueAssignedUserId]", "=", AssignedUserId, SqlDbType.NVarChar);
                    }

                    queryClauses.Add(q);
                }

                if (!string.IsNullOrEmpty(IssueStatusId))
                {
                    if(IssueStatusId == "-2")
                    {
                        // filter by closed issues
                        isStatus = true;
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "1", SqlDbType.Int));
                    }
                    else if (IssueStatusId != "-1")
                    {
                        isStatus = true;
                        q = IssueStatusId == "0" ?
                            new QueryClause("AND", "iv.[IssueStatusId]", "IS", null, SqlDbType.Int) :
                            new QueryClause("AND", "iv.[IssueStatusId]", "=", IssueStatusId, SqlDbType.Int);

                        queryClauses.Add(q);
                    }
                    else
                    {
                        isStatus = true;
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                    }
                }

                // exclude all closed status's
                if (!isStatus)
                {
                    queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                }

                try
                {
                    //colIssues = IssueManager.PerformQuery(queryClauses, ProjectId);

                    // TODO: WARNING Potential Cross Site Scripting attack
                    // also this code only runs if the previous code does not freak out
                    ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?{0}&channel=7", Request.QueryString);
                }
                catch
                {
                    // BGN-1379
                    // This URL http://localhost/BugNET/Issues/IssueList.aspx?pid=96&c=4471%27;
                    // Generates a Input string was not in a correct format exception in
                    // Source File:  C:\Development\BugNET 0.7.921 SVN Source\branches\BugNET 0.8\src\BugNET_WAP\Old_App_Code\DAL\SqlDataProvider.cs    Line:  4932 
                    // Line 4932:                gcfr(sqlCmd.ExecuteReader(), ref List);
                    isError = true;

                    // perhaps this should rather ErrorRedirector.TransferToErrorPage(Page);
                    // but an empty grid with "There are no issues that match your criteria." looks 
                    // nice too
                }
            }
            else
            {
                var userName = Security.GetUserName();

                switch (dropView.SelectedValue)
                {
                    case "Relevant":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));

                        queryClauses.Add(new QueryClause("AND (", "iv.[AssignedUsername]", "=", userName, SqlDbType.NVarChar));
                        queryClauses.Add(new QueryClause("OR", "iv.[CreatorUsername]", "=", userName, SqlDbType.NVarChar));
                        queryClauses.Add(new QueryClause("OR", "iv.[OwnerUsername]", "=", userName, SqlDbType.NVarChar));
                        queryClauses.Add(new QueryClause(")", "", "", "", SqlDbType.NVarChar));

                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=8", ProjectId);
                        break;
                    case "Assigned":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                        queryClauses.Add(new QueryClause("AND", "iv.[AssignedUsername]", "=", userName, SqlDbType.NVarChar));

                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=9", ProjectId);
                        break;
                    case "Owned":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                        queryClauses.Add(new QueryClause("AND", "iv.[OwnerUsername]", "=", userName, SqlDbType.NVarChar));

                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=10", ProjectId);
                        break;
                    case "Created":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                        queryClauses.Add(new QueryClause("AND", "iv.[CreatorUsername]", "=", userName, SqlDbType.NVarChar));

                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=11", ProjectId);
                        break;
                    case "All":
                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=12", ProjectId);
                        break;
                    case "Open":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int));
                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=14", ProjectId);
                        break;
                    case "Closed":
                        queryClauses.Add(new QueryClause("AND", "iv.[IsClosed]", "=", "1", SqlDbType.Int));
                        ctlDisplayIssues.RssUrl = string.Format("~/Feed.aspx?pid={0}&channel=16", ProjectId);
                        break;
                }
            }

            if (isError) return;

            var sortColumns = new List<KeyValuePair<string, string>>();

            if (Request.QueryString["cr"] != null)
                sortColumns.Add(new KeyValuePair<string, string>("iv.[DateCreated]", "desc"));

            if (Request.QueryString["ur"] != null)
                sortColumns.Add(new KeyValuePair<string, string>("iv.[LastUpdate]", "desc"));

            var sorter = ctlDisplayIssues.SortString;

            foreach (var sort in sorter.Split(','))
            {
                var args = sort.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                if (args.Length.Equals(2))
                    sortColumns.Add(new KeyValuePair<string, string>(args[0], args[1]));

            }

            var colIssues = IssueManager.PerformQuery(queryClauses, sortColumns, ProjectId);

            ctlDisplayIssues.DataSource = colIssues;
            ctlDisplayIssues.DataBind();
        }
Ejemplo n.º 11
0
        public void TestPerformQuery()
        {
            List<QueryClause> clauses = new List<QueryClause>();

            QueryClause q = new QueryClause()
            {
                BooleanOperator = "OR",
                ComparisonOperator = "=",
                DataType = SqlDbType.Int,
                FieldName = "IssueCategoryId",
                FieldValue = null

            };    
            clauses.Add(q);

            q = new QueryClause()
            {
                BooleanOperator = "AND",
                ComparisonOperator = "<>",
                DataType = SqlDbType.Int,
                FieldName = "IssueStatusId",
                FieldValue = "3"

            };

            clauses.Add(q);

            List<Issue> results = IssueManager.PerformQuery(clauses, 96);

            foreach (Issue result in results)
                Console.WriteLine("Id: {1}; Title: {0}", result.Title, result.Id);

            Assert.IsTrue(results.Count > 0);

        }
Ejemplo n.º 12
0
        /// <summary>
        /// Filtereds the issues feed.
        /// </summary>
        /// <param name="feed">The feed.</param>
        private void FilteredIssuesFeed(ref SyndicationFeed feed)
        {
            QueryClause q;
            bool isStatus = false;
            string BooleanOperator = "AND";
            List<QueryClause> queryClauses = new List<QueryClause>();

            if (!string.IsNullOrEmpty(IssueCategoryId))
            {
                q = new QueryClause(BooleanOperator, "IssueCategoryId", "=", IssueCategoryId.ToString(), SqlDbType.Int, false);
                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(IssueTypeId))
            {
                q = new QueryClause(BooleanOperator, "IssueTypeId", "=", IssueTypeId.ToString(), SqlDbType.Int, false);
                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(IssueMilestoneId))
            {
                //if zero, do a null comparison.
                if (IssueMilestoneId == "0")
                    q = new QueryClause(BooleanOperator, "IssueMilestoneId", "IS", null, SqlDbType.Int, false);
                else
                    q = new QueryClause(BooleanOperator, "IssueMilestoneId", "=", IssueMilestoneId, SqlDbType.Int, false);

                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(IssueResolutionId))
            {
                q = new QueryClause(BooleanOperator, "IssueResolutionId", "=", IssueResolutionId.ToString(), SqlDbType.Int, false);
                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(IssuePriorityId))
            {
                q = new QueryClause(BooleanOperator, "IssuePriorityId", "=", IssuePriorityId.ToString(), SqlDbType.Int, false);
                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(IssueStatusId))
            {
                isStatus = true;
                q = new QueryClause(BooleanOperator, "IssueStatusId", "=", IssueStatusId.ToString(), SqlDbType.Int, false);
                queryClauses.Add(q);
            }
            if (!string.IsNullOrEmpty(AssignedUserName))
            {
                if (AssignedUserName == "0")
                    q = new QueryClause(BooleanOperator, "IssueAssignedUserId", "IS", null, SqlDbType.NVarChar, false);
                else
                    q = new QueryClause(BooleanOperator, "IssueAssignedUserId", "=", AssignedUserName, SqlDbType.NVarChar, false);
                queryClauses.Add(q);
            }

            //exclude all closed status's
            if (!isStatus)
            {
                List<Status> status = StatusManager.GetByProjectId(ProjectId).FindAll(delegate(Status s) { return s.IsClosedState == true; });
                foreach (Status st in status)
                {
                    q = new QueryClause(BooleanOperator, "IssueStatusId", "<>", st.Id.ToString(), SqlDbType.Int, false);
                    queryClauses.Add(q);
                }
            }
            //q = new QueryClause(BooleanOperator, "new", "=", "another one", SqlDbType.NVarChar, true);
            //queryClauses.Add(q);
            List<Issue> issueList = IssueManager.PerformQuery(queryClauses, ProjectId);
            List<SyndicationItem> feedItems = CreateSyndicationItemsFromIssueList(issueList);
            Project p = ProjectManager.GetById(ProjectId);

            feed.Title = TextSyndicationContent.CreatePlaintextContent(string.Format(GetLocalResourceObject("FilteredIssuesTitle").ToString(), p.Name));
            feed.Description = TextSyndicationContent.CreatePlaintextContent(string.Format(GetLocalResourceObject("FilteredIssuesDescription").ToString(), p.Name));
            feed.Items = feedItems;
        }