public void InsertConversation(Guid ticketId, string message, string attachment, Guid userId, bool staff, string userEmailId) { TicketAndTicketConversationRow ticketAndTicketConversationRow = new TicketAndTicketConversationRow(); ticketAndTicketConversationRow.PartitionKey = userEmailId; ticketAndTicketConversationRow.FID = Guid.NewGuid(); ticketAndTicketConversationRow.Kind = Kind.TicketConversation.ToString(); ticketAndTicketConversationRow.TicketId = ticketId; ticketAndTicketConversationRow.Message = message; ticketAndTicketConversationRow.Attachment = attachment; ticketAndTicketConversationRow.UserId = userId; ticketAndTicketConversationRow.Staff = staff.ToString(); ticketAndTicketConversationRow.UserEmail = userEmailId; ticketAndTicketConversationRow.LastUpdate = DateTime.Now; ticketAndTicketConversationRow.InsertDate = DateTime.Now; TableDataStore tableDataStore = new TableDataStore(); tableDataStore.Insert(ticketAndTicketConversationRow); //connection.ExecuteSQL(cmdText); }
public DataTable GetUserTicket(string userEmailId, Guid ticketID) { var tableDataStore = new TableDataStore(); var amsEventTrackingEntity = tableDataStore.Read <TicketAndTicketConversationRow>( x => x.PartitionKey == userEmailId && x.RowKey == ticketID.ToString()) .FirstOrDefault(); return(ModelExtensions.GetDataTableFromObjects(new [] { amsEventTrackingEntity })); }
public DataTable GetUserAllTickets(string userEmailId) { string query = "select * from Ticket where UserEmail = '" + userEmailId + "' Order by LastUpdate desc"; var tableDataStore = new TableDataStore(); var amsEventTrackingEntity = tableDataStore.Read <TicketAndTicketConversationRow>( x => x.PartitionKey == userEmailId) .FirstOrDefault(); return(ModelExtensions.GetDataTableFromObjects(new[] { amsEventTrackingEntity })); return(null); }
public DataTable GetConversion(string userEmailId, Guid ticketId) { string query = "select * from TicketConversation where ticketId = '" + ticketId.ToString() + "' Order by insertDate"; // connection.Select(query); // return new DataTable(); var tableDataStore = new TableDataStore(); var amsEventTrackingEntity = tableDataStore.Read <TicketAndTicketConversationRow>( x => x.PartitionKey == userEmailId && x.TicketId == ticketId && x.Kind == Kind.TicketConversation.ToString()) .FirstOrDefault(); return(ModelExtensions.GetDataTableFromObjects(new [] { amsEventTrackingEntity })); }
public void InsertTicket(Guid ticketId, string status, string priority, string subject, string type, string userEmailId, string domain, string contactNumber, string department, string lastReplier, string userName) { TicketAndTicketConversationRow ticketAndTicketConversationRow = new TicketAndTicketConversationRow(); ticketAndTicketConversationRow.PartitionKey = userEmailId; ticketAndTicketConversationRow.RowKey = ticketId.ToString(); ticketAndTicketConversationRow.Kind = Kind.Ticket.ToString(); ticketAndTicketConversationRow.TicketNumber = DateTime.Now.GetHashCode(); // ticketAndTicketConversationRow.TicketId = ticketId; ticketAndTicketConversationRow.Status = status; ticketAndTicketConversationRow.Priority = priority; ticketAndTicketConversationRow.Subject = subject; ticketAndTicketConversationRow.Type = type; ticketAndTicketConversationRow.UserEmail = userEmailId; ticketAndTicketConversationRow.Domain = domain; ticketAndTicketConversationRow.ContactNumber = contactNumber; ticketAndTicketConversationRow.Department = department; ticketAndTicketConversationRow.LastReplier = lastReplier; ticketAndTicketConversationRow.UserName = userName; ticketAndTicketConversationRow.LastUpdate = DateTime.Now; ticketAndTicketConversationRow.InsertDate = DateTime.Now; TableDataStore tableDataStore = new TableDataStore(); tableDataStore.Insert(ticketAndTicketConversationRow); }