Exemplo n.º 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;
        }
Exemplo n.º 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";
        }
Exemplo n.º 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";
        }
Exemplo n.º 4
0
        public void UpdateTicket(TicketInfo ticket, string comment)
        {
            ValidateTicket(ticket);

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

            ticket.Update(values);
        }
Exemplo n.º 5
0
        public void UpdateTicket(TicketInfo ticket, string comment)
        {
            ValidateTicket(ticket);

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

            ticket.Update(values);
        }
Exemplo n.º 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");
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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");
        }
Exemplo n.º 9
0
 public string[] GetAvailableActions(TicketInfo ticket)
 {
     ValidateTicket(ticket);
     return _ticket.GetAvailableActions(ticket.TicketId);
 }
Exemplo n.º 10
0
        public void DeleteTicket(TicketInfo ticket)
        {
            ValidateTicket(ticket);

            DeleteTicket(ticket.TicketId);
        }
Exemplo n.º 11
0
 public string[] GetAvailableActions(TicketInfo ticket)
 {
     ValidateTicket(ticket);
     return(_ticket.GetAvailableActions(ticket.TicketId));
 }
Exemplo n.º 12
0
        public void DeleteTicket(TicketInfo ticket)
        {
            ValidateTicket(ticket);

            DeleteTicket(ticket.TicketId);
        }