コード例 #1
0
        public void CreateTicket(TicketInfo ticket)
        {
            if (string.IsNullOrEmpty(ticket.Summary)) throw new ArgumentNullException("ticket.Summary");

            if (string.IsNullOrEmpty(ticket.Description)) throw new ArgumentNullException("ticket.Description");

            if (string.IsNullOrEmpty(ticket.Type)) throw new ArgumentNullException("ticket.Type");

            if (string.IsNullOrEmpty(ticket.Priority)) throw new ArgumentNullException("ticket.Priority");

            if (string.IsNullOrEmpty(ticket.Component)) throw new ArgumentNullException("ticket.Component");

            XmlRpcStruct tempAttributes = new XmlRpcStruct();

            foreach (object key in ticket.Attributes.Keys)
            {

                if ((((string)key) != TicketAttributes.Description) && (((string)key) != TicketAttributes.Summary))
                {

                    tempAttributes.Add(key, ticket.Attributes[key]);

                }

            }

            int id = _ticket.Create(ticket.Summary, ticket.Description, ticket.Attributes);

            ticket.TicketId = id;
        }
コード例 #2
0
        protected void CreateWikiPage(object sender, EventArgs e)
        {
            string password = tbPassword.Text;
            if (tbPassword.Visible == false)
            {
                password = Session["tracPassword"].ToString();
            }

            TicketManager manager = new TicketManager();
            manager.Connect("http://trac/projects/int900.0010upac/login/xmlrpc", tbUsername.Text, password);

            TicketInfo info = new TicketInfo();
            info.Summary = tbSummery.Text;
            info.Description = tbContent.Text;
            info.Milestone = ddlMilestone.SelectedValue;
            info.Type = "Projektopgave";
            info.Priority = "major";
            info.Component = "Core";
            info.EstimatedNumberOfHours = tbEstimatedNumberOfHours.Text;
            manager.CreateTicket(info);

            //tbPassword.Text = string.Empty;
            tbSummery.Text = string.Empty;
            tbContent.Text = string.Empty;

            ltrMessage.Text = "Ticket created";
        }
コード例 #3
0
        protected void CreateWikiPage(object sender, EventArgs e)
        {
            string password = tbPassword.Text;

            if (tbPassword.Visible == false)
            {
                password = Session["tracPassword"].ToString();
            }

            TicketManager manager = new TicketManager();

            manager.Connect("http://trac/projects/int900.0010upac/login/xmlrpc", tbUsername.Text, password);

            TicketInfo info = new TicketInfo();

            info.Summary                = tbSummery.Text;
            info.Description            = tbContent.Text;
            info.Milestone              = ddlMilestone.SelectedValue;
            info.Type                   = "Projektopgave";
            info.Priority               = "major";
            info.Component              = "Core";
            info.EstimatedNumberOfHours = tbEstimatedNumberOfHours.Text;
            manager.CreateTicket(info);

            //tbPassword.Text = string.Empty;
            tbSummery.Text = string.Empty;
            tbContent.Text = string.Empty;

            ltrMessage.Text = "Ticket created";
        }
コード例 #4
0
        public void UpdateTicket(TicketInfo ticket, string comment)
        {
            ValidateTicket(ticket);

            object[] values = _ticket.Update(ticket.TicketId, comment, ticket.Attributes);

            ticket.Update(values);
        }
コード例 #5
0
        public void UpdateTicket(TicketInfo ticket, string comment)
        {
            ValidateTicket(ticket);

            object[] values = _ticket.Update(ticket.TicketId, comment, ticket.Attributes);

            ticket.Update(values);
        }
コード例 #6
0
        private void ValidateTicket(TicketInfo ticket)
        {
            if (ticket == null)
            {
                throw new ArgumentNullException("ticket");
            }

            if (ticket.TicketId <= 0)
            {
                throw new ArgumentException("ticketId must be greater then 0");
            }
        }
コード例 #7
0
        public void CreateTicket(TicketInfo ticket)
        {
            if (string.IsNullOrEmpty(ticket.Summary))
            {
                throw new ArgumentNullException("ticket.Summary");
            }

            if (string.IsNullOrEmpty(ticket.Description))
            {
                throw new ArgumentNullException("ticket.Description");
            }

            if (string.IsNullOrEmpty(ticket.Type))
            {
                throw new ArgumentNullException("ticket.Type");
            }

            if (string.IsNullOrEmpty(ticket.Priority))
            {
                throw new ArgumentNullException("ticket.Priority");
            }

            if (string.IsNullOrEmpty(ticket.Component))
            {
                throw new ArgumentNullException("ticket.Component");
            }

            XmlRpcStruct tempAttributes = new XmlRpcStruct();

            foreach (object key in ticket.Attributes.Keys)
            {
                if ((((string)key) != TicketAttributes.Description) && (((string)key) != TicketAttributes.Summary))
                {
                    tempAttributes.Add(key, ticket.Attributes[key]);
                }
            }

            int id = _ticket.Create(ticket.Summary, ticket.Description, ticket.Attributes);

            ticket.TicketId = id;
        }
コード例 #8
0
        private void ValidateTicket(TicketInfo ticket)
        {
            if (ticket == null) throw new ArgumentNullException("ticket");

            if (ticket.TicketId <= 0) throw new ArgumentException("ticketId must be greater then 0");
        }
コード例 #9
0
 public string[] GetAvailableActions(TicketInfo ticket)
 {
     ValidateTicket(ticket);
     return _ticket.GetAvailableActions(ticket.TicketId);
 }
コード例 #10
0
        public void DeleteTicket(TicketInfo ticket)
        {
            ValidateTicket(ticket);

            DeleteTicket(ticket.TicketId);
        }
コード例 #11
0
 public string[] GetAvailableActions(TicketInfo ticket)
 {
     ValidateTicket(ticket);
     return(_ticket.GetAvailableActions(ticket.TicketId));
 }
コード例 #12
0
        public void DeleteTicket(TicketInfo ticket)
        {
            ValidateTicket(ticket);

            DeleteTicket(ticket.TicketId);
        }