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; }
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"; }
public void UpdateTicket(TicketInfo ticket, string comment) { ValidateTicket(ticket); object[] values = _ticket.Update(ticket.TicketId, comment, ticket.Attributes); ticket.Update(values); }
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"); } }
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; }
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"); }
public string[] GetAvailableActions(TicketInfo ticket) { ValidateTicket(ticket); return _ticket.GetAvailableActions(ticket.TicketId); }
public void DeleteTicket(TicketInfo ticket) { ValidateTicket(ticket); DeleteTicket(ticket.TicketId); }
public string[] GetAvailableActions(TicketInfo ticket) { ValidateTicket(ticket); return(_ticket.GetAvailableActions(ticket.TicketId)); }