public string AddTicket(string title, string description, string token, int?parent) { dynamic res = null; int id = isValidToken(token); if (id < 0) { res = new { error = "Invalid Token!" }; } else { dynamic rows = Database.AddTicket(title, description, id, parent); if (rows == null || rows <= 0) { res = new { error = "Couldn't add a new ticket!" }; } else { res = new { success = "Ticket added!" }; } } TTCallbacks.m_event(); return(JsonConvert.SerializeObject(res)); }
public string AnswerTicketDepartment(int id, string answer) { dynamic res = null; dynamic rows = Database.AnswerTicketDepartment(id, answer); if (rows == null || rows <= 0) { res = new { error = "Couldn't answer ticket!" }; } else { res = new { success = "Ticket answered!" }; } TTCallbacks.m_event(); return(JsonConvert.SerializeObject(res)); }
public string AssignTicket(int id, int assignee) { dynamic res = null; dynamic rows = Database.AssignTicket(id, assignee); if (rows == null || rows <= 0) { res = new { error = "Couldn't assign ticket!" }; } else { res = new { success = "Ticket assigned!" }; } TTCallbacks.m_event(); return(JsonConvert.SerializeObject(res)); }
public string AddTicketDepartment(string description, int author, int department) { dynamic res = null; dynamic rows = Database.AddTicketDepartment(description, author, department); if (rows == null || rows <= 0) { res = new { error = "Couldn't add a new ticket!" }; } else { res = new { success = "Ticket added!" }; } TTCallbacks.m_event(); return(JsonConvert.SerializeObject(res)); }
public string HelloWorld(string name) { TTCallbacks.m_event(); return("test"); }