public async Task <ActionResult <bool> > PostAddTicketingChat(DeveloperTicketViewModel model) { string userId = User.Claims.First(c => c.Type == "seemsys").Value; Person s = await _context.People.SingleOrDefaultAsync(y => y.Role1 == 2 && y.Role2 == 1 && y.Role3 == 1 && y.Role4 == 1); DeveloperTicket ticket = new DeveloperTicket() { PersonNational_ID = userId, DateOfCreation = DateTime.Now.ToString(), Active = true, Closure = DateTime.Now.ToString(), Status = model.Status, Resiver = s.PersonNational_ID }; DeveloperTicketChat ticketingChat = new DeveloperTicketChat() { DeveloperTicket_ID = await _developerTicketService.AddTicket(ticket), Comment = model.Comment, CommentTime = DateTime.Now.ToString(), PersonNational_ID = userId, Confidential = false, Resiver = s.PersonNational_ID, Sender = userId, Seen = false }; return(await _developerTicketService.AddTicketingChat(ticketingChat)); }
/////اضافه کردن پیام در هر گفت و گو////// public async Task <bool> AddTicketingChat(DeveloperTicketChat ticket) { await _context.DeveloperTicketChats.AddAsync(ticket); await _context.SaveChangesAsync(); return(true); }
/////اضافه کردن پیام در هر گفت و گو////// public async Task <bool> AddComment(DeveloperTicketChat developerTicketChat) { await _context.DeveloperTicketChats.AddAsync(developerTicketChat); await _context.SaveChangesAsync(); return(true); }
public async Task <ActionResult <bool> > PostAddTicketingChat(DeveloperTicketigViewModel model) { bool t; string u; string userId = User.Claims.First(c => c.Type == "seemsys").Value; if (model.Resiver == "" || model.Resiver == null) { Person s = await _context.People.SingleOrDefaultAsync(y => y.Role1 == 2 && y.Role2 == 1 && y.Role3 == 1 && y.Role4 == 1); u = s.PersonNational_ID; } else { u = model.Resiver; } if (model.Conf == 1) { t = true; } else { t = false; } DeveloperTicketChat ticketingChat = new DeveloperTicketChat() { DeveloperTicket_ID = model.DeveloperTicket_ID, Comment = model.Comment, CommentTime = DateTime.Now.ToString(), PersonNational_ID = userId, Sender = userId, Resiver = u, Confidential = t, Seen = false }; return(await _developerTicketService.AddComment(ticketingChat)); }