public static TicketReminderModel[] GetTicketReminders(TicketModel ticket)
 {
     int[] reminderIDs = IDReader.Read(TicketChild.TicketReminders, ticket);
     TicketReminderModel[] reminderModels = new TicketReminderModel[reminderIDs.Length];
     for (int i = 0; i < reminderIDs.Length; ++i)
     {
         reminderModels[i] = new TicketReminderModel(ticket, reminderIDs[i], false);
     }
     return(reminderModels);
 }
Exemplo n.º 2
0
        //public TaskAssociationModel[] TaskAssociations() { return TaskAssociationModel.GetTaskAssociations(this); }
        //public TicketQueueModel[] TicketQueue() { return TicketQueueModel.GetQueuedTicket(this); }


        public TicketModel[] ChildTickets()
        {
            int[]         ticketIDs    = IDReader.Read(TicketChild.Children, this);
            TicketModel[] childTickets = new TicketModel[ticketIDs.Length];
            for (int i = 0; i < ticketIDs.Length; ++i)
            {
                childTickets[i] = new TicketModel(Organization, ticketIDs[i]);
            }
            return(childTickets);
        }
 /// <summary> find all the contact organizations associated with a ticket </summary>
 public static OrganizationTicketModel[] GetOrganizationTickets(TicketModel ticket)
 {
     //$"Select OrganizationID From OrganizationTickets WITH (NOLOCK) WHERE TicketId = {ticket.TicketID}"
     int[] customerIDs = IDReader.Read(TicketChild.Customers, ticket);
     OrganizationTicketModel[] organizationTickets = new OrganizationTicketModel[customerIDs.Length];
     for (int i = 0; i < customerIDs.Length; ++i)
     {
         organizationTickets[i] = new OrganizationTicketModel(ticket, new OrganizationModel(ticket.Connection, customerIDs[i]), false);
     }
     return(organizationTickets);
 }
Exemplo n.º 4
0
 public static SubscriptionModel[] GetSubscriptions(TicketModel ticket)
 {
     //query = $"SELECT Subscriptions.userid FROM Subscriptions WITH (NOLOCK) " +
     //        $"JOIN Users WITH (NOLOCK) on users.userid = Subscriptions.userid " +
     //        $"WHERE Reftype = 17 and Refid = {ticket.TicketID} and MarkDeleted = 0";
     int[] subscriptionUserIDs         = IDReader.Read(TicketChild.Subscriptions, ticket);
     SubscriptionModel[] subscriptions = new SubscriptionModel[subscriptionUserIDs.Length];
     for (int i = 0; i < subscriptionUserIDs.Length; ++i)
     {
         subscriptions[i] = new SubscriptionModel(ticket, new UserModel(ticket.Connection, subscriptionUserIDs[i]), false);
     }
     return(subscriptions);
 }
Exemplo n.º 5
0
        public static UserTicketModel[] GetUserTickets(TicketModel ticket)
        {
            //query = $"SELECT Users.userid FROM Users WITH (NOLOCK)" +
            //    $"JOIN UserTickets WITH (NOLOCK) on UserTickets.userid = Users.UserID" +
            //    $" WHERE UserTickets.TicketID = {ticket.TicketID} AND (Users.MarkDeleted = 0)";

            int[]             contactIDs = IDReader.Read(TicketChild.Contacts, ticket);
            UserTicketModel[] contacts   = new UserTicketModel[contactIDs.Length];
            for (int i = 0; i < contactIDs.Length; ++i)
            {
                contacts[i] = new UserTicketModel(ticket, new UserModel(ticket.Connection, contactIDs[i]), false);
            }
            return(contacts);
        }