Пример #1
0
        /// <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();
            }
        }
Пример #2
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;
        }
Пример #3
0
 public ActionResult Create(Ticket ticket)
 {
     ticketrepository.Create(ticket);
     return(RedirectToAction("Index"));
 }