/// <summary> /// 提交新工单 /// </summary> /// <param name="t">工单信息</param> /// <param name="tc">内容信息</param> void ITicket.Publish(TTicket t, TTicketChat tc) { using (TransactionScope scope = new TransactionScope()) { m_iTicket.Create(t); m_iTicket.AddReply(t, new TTicketChat { TicketId = t.TicketId, Content = tc.Content, UserId = tc.UserId, Annex = tc.Annex }); scope.Complete(); } }
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; }
public ActionResult Create(Ticket ticket) { ticketrepository.Create(ticket); return(RedirectToAction("Index")); }