public Ticket createTicket(string subject, string text, int ownerId) { Ticket ticket = new Ticket(); ticket.Id = -1; ticket.Subject = subject; ticket.fiClient = ownerId; TicketApiController tc = new TicketApiController(); ticket = tc.PostSave(ticket); TicketText tt = new TicketText(); tt.Id = -1; tt.Text = text; tt.isAdmin = false; tt.fiClient = ownerId; tt.fiAdmin = 0; tt.fiTicket = ticket.Id; TicketTextApiController ttc = new TicketTextApiController(); ttc.PostSave(tt); return(ticket); }
public TicketText answerTicket(string text, int ownerId, int ticketId) { TicketText t = new TicketText(); t.Id = -1; t.Text = text; t.fiTicket = ticketId; t.fiAdmin = 0; t.isAdmin = false; t.fiClient = ownerId; t.createTS = DateTime.Now; t.modifyTS = DateTime.Now; TicketTextApiController ttc = new TicketTextApiController(); t = ttc.PostSave(t); return(t); }