예제 #1
0
        public Ticket AddSupportTicket(Ticket supportTicket)
        {
            var obj = ticketRepository.Add(supportTicket);

            var noti = new Notification()
            {
                Id = Guid.NewGuid(),
                To = "admin",
                CreateBy = supportTicket.CreateBy,
                CreateAt = DateTime.Now,
                Read = false,
                Title = supportTicket.Title

            };

            notificationRepository.Add(noti);

            return obj;
        }
예제 #2
0
        public Ticket ReplySupportTicket(Ticket supportTicket)
        {
            foreach (var item in supportTicket.TicketItems)
            {
                if (item.Id == Guid.Empty)
                {
                    item.Id = Guid.NewGuid();
                    ticketItemRepository.Add(item);
                }
            }

            //Notify to ticket owner
            var noti = new Notification()
            {
                Id = Guid.NewGuid(),
                To = supportTicket.CreateBy,
                CreateBy = supportTicket.CreateBy,
                CreateAt = DateTime.Now,
                Read = false,
                Title = supportTicket.Title

            };

            notificationRepository.Add(noti);
            return supportTicket;
        }
예제 #3
0
 public Notification Update(Notification notification)
 {
     throw new NotImplementedException();
 }