Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        linkBack.NavigateUrl = string.Format("BugView.aspx?id={0}", RequestId);

        if (!IsPostBack)
        {
            selectResolution.DataSource = SessionManager.BugService.GetBugResolutions(
                SessionManager.Ticket, null);
            selectResolution.DataBind();

            TransitBug bug = SessionManager.BugService.GetBugById(
                SessionManager.Ticket, RequestId);
            TransitBugProject project = SessionManager.BugService.GetBugProjectById(
                SessionManager.Ticket, bug.ProjectId);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request, string.Format("BugView.aspx?id={0}", bug.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Resolve", Request.Url));
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Example #2
0
    public void save_Click(object sender, EventArgs e)
    {
        TransitBug t = new TransitBug();

        t.Subject   = inputSubject.Text;
        t.Details   = inputDetails.Text;
        t.Priority  = selectPriority.SelectedValue;
        t.Severity  = selectSeverity.SelectedValue;
        t.Type      = selectType.SelectedValue;
        t.ProjectId = ProjectId;
        t.Id        = RequestId;
        int bugid = SessionManager.CreateOrUpdate <TransitBug>(
            t, SessionManager.BugService.CreateOrUpdateBug);

        Redirect(string.Format("BugView.aspx?id={0}", bugid));
    }
Example #3
0
    public void linkSwitchMode_Click(object sender, EventArgs e)
    {
        TransitBug bug = SessionManager.BugService.GetBugById(
            SessionManager.Ticket, RequestId);

        switch (linkSwitchMode.CommandArgument)
        {
        case "Text":
            linkSwitchMode.Text            = "&#187; html";
            linkSwitchMode.CommandArgument = "Html";
            break;

        case "Html":
            linkSwitchMode.Text            = "&#187; text";
            linkSwitchMode.CommandArgument = "Text";
            break;
        }

        bugDetails.Text = RenderEx(bug.Details);
        gridNotes_OnGetDataSource(this, null);
        gridNotes.DataBind();
    }
Example #4
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TransitBug bug = SessionManager.BugService.GetBugById(
                SessionManager.Ticket, BugId);
            TransitBugProject project = SessionManager.BugService.GetBugProjectById(
                SessionManager.Ticket, bug.ProjectId);

            imageBugType.ImageUrl = string.Format("images/bugs/type_{0}.gif", bug.Type);
            bugType.Text          = Renderer.Render(bug.Type);
            bugId.Text            = string.Format("#{0}", bug.Id);
            bugSubject.Text       = Renderer.Render(bug.Subject);
            bugType.Text          = Renderer.Render(bug.Type);
            linkBack.NavigateUrl  = string.Format("BugView.aspx?id={0}", bug.Id);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request, string.Format("BugView.aspx?id={0}", bug.Id)));

            if (RequestId > 0)
            {
                TransitBugNote t = SessionManager.BugService.GetBugNoteById(
                    SessionManager.Ticket, RequestId);
                inputNote.Text = t.Details;
                sitemapdata.Add(new SiteMapDataAttributeNode("Edit Note", Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Note", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Example #5
0
 public void save_Click(object sender, EventArgs e)
 {
     TransitBug t = new TransitBug();
     t.Subject = inputSubject.Text;
     t.Details = inputDetails.Text;
     t.Priority = selectPriority.SelectedValue;
     t.Severity = selectSeverity.SelectedValue;
     t.Type = selectType.SelectedValue;
     t.ProjectId = ProjectId;
     t.Id = RequestId;
     int bugid = SessionManager.CreateOrUpdate<TransitBug>(
         t, SessionManager.BugService.CreateOrUpdateBug);
     Redirect(string.Format("BugView.aspx?id={0}", bugid));
 }
Example #6
0
 public int CreateOrUpdateBug(string ticket, TransitBug bug)
 {
     return(WebServiceImpl <TransitBug, ManagedBug, Bug> .CreateOrUpdate(
                ticket, bug));
 }
Example #7
0
 public int CreateOrUpdateBug(string ticket, TransitBug bug)
 {
     return WebServiceImpl<TransitBug, ManagedBug, Bug>.CreateOrUpdate(
         ticket, bug);
 }
Example #8
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DomainClass cs = SessionManager.GetDomainClass("Bug");
            inputSubject.MaxLength = cs["Subject"].MaxLengthInChars;

            selectPriority.DataSource = SessionManager.BugService.GetBugPriorities(
                SessionManager.Ticket, null);
            selectPriority.DataBind();
            selectSeverity.DataSource = SessionManager.BugService.GetBugSeverities(
                SessionManager.Ticket, null);
            selectSeverity.DataBind();
            selectType.DataSource = SessionManager.BugService.GetBugTypes(
                SessionManager.Ticket, null);
            selectType.DataBind();

            TransitBugProject project = SessionManager.BugService.GetBugProjectById(
                SessionManager.Ticket, ProjectId);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));

            if (RequestId > 0)
            {
                TransitBug bug = SessionManager.BugService.GetBugById(
                    SessionManager.Ticket, RequestId);
                inputSubject.Text = bug.Subject;
                inputDetails.Text = bug.Details;

                ListItemManager.TrySelect(selectPriority, bug.Priority);
                ListItemManager.TrySelect(selectSeverity, bug.Severity);
                ListItemManager.TrySelect(selectType, bug.Type);

                linkBack.NavigateUrl = string.Format("BugView.aspx?id={0}", bug.Id);

                sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request.Url));
            }
            else
            {
                string type = Request.QueryString["type"];
                ListItemManager.TrySelect(selectType, type);

                linkBack.NavigateUrl = string.Format("BugProjectBugsManage.aspx?id={0}", ProjectId);

                if (Request.QueryString["url"] != null)
                {
                    inputSubject.Text = Request.QueryString["url"];
                }

                if (Request.QueryString["message"] != null)
                {
                    inputDetails.Text = Request.QueryString["message"];
                }

                sitemapdata.Add(new SiteMapDataAttributeNode("New Bug", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Example #9
0
    void GetBug()
    {
        TransitBug bug = SessionManager.BugService.GetBugById(
            SessionManager.Ticket, RequestId);
        TransitBugProject project = SessionManager.BugService.GetBugProjectById(
            SessionManager.Ticket, bug.ProjectId);

        this.Title = string.Format("{0} #{1}: {2}", Renderer.Render(project.Name), bug.Id, Renderer.Render(bug.Subject));

        bugProject.Text          = linkProject2.Text = Renderer.Render(project.Name);
        linkProject2.NavigateUrl = string.Format("BugProjectBugsManage.aspx?id={0}", project.Id);
        imageBugType.ImageUrl    = string.Format("images/bugs/type_{0}.gif", bug.Type);
        bugType.Text             = Renderer.Render(bug.Type);
        bugCreated.Text          = bug.Created.ToString();
        bugUpdated.Text          = bug.Updated.ToString();
        bugDetails.Text          = RenderEx(bug.Details);
        bugId.Text              = string.Format("#{0}", bug.Id);
        bugPriority.Text        = Renderer.Render(bug.Priority);
        bugResolution.Text      = Renderer.Render(bug.Resolution);
        bugSeverity.Text        = Renderer.Render(bug.Severity);
        bugStatus.Text          = Renderer.Render(bug.Status);
        bugSubject.Text         = Renderer.Render(bug.Subject);
        bugType.Text            = Renderer.Render(bug.Type);
        linkAccount.Text        = Renderer.Render(bug.AccountName);
        linkAccount.NavigateUrl = string.Format("AccountView.aspx?id={0}", bug.AccountId);
        linkAddNew.NavigateUrl  = string.Format("BugEdit.aspx?pid={0}", bug.ProjectId);

        linkEdit.Enabled   = SessionManager.IsAdministrator;
        linkAction.Enabled = SessionManager.IsAdministrator;

        switch (bug.Status)
        {
        case "Closed":
            linkAction.Text        = "Reopen Bug";
            linkAction.CommandName = "Reopen";
            break;

        case "Resolved":
            linkAction.Text        = "Close Bug";
            linkAction.CommandName = "Close";
            break;

        default:
            linkAction.Text        = "Resolve Bug";
            linkAction.CommandName = "Resolve";
            break;
        }

        linkEdit.NavigateUrl    = string.Format("BugEdit.aspx?pid={0}&id={1}", project.Id, bug.Id);
        linkAddNote.NavigateUrl = string.Format("BugNoteEdit.aspx?bid={0}", bug.Id);

        gridNotes_OnGetDataSource(this, null);
        gridNotes.DataBind();

        SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();

        sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx"));
        sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id)));
        sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request.Url));
        StackSiteMap(sitemapdata);
    }