Пример #1
0
        public static TicketRelationship GetTicketRelationship(LoginUser loginUser, int ticketRelationshipID)
        {
            TicketRelationships ticketRelationships = new TicketRelationships(loginUser);

            ticketRelationships.LoadByTicketRelationshipID(ticketRelationshipID);
            if (ticketRelationships.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(ticketRelationships[0]);
            }
        }
Пример #2
0
        public static TicketRelationship GetTicketRelationship(LoginUser loginUser, int ticket1ID, int ticket2ID)
        {
            TicketRelationships items = new TicketRelationships(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = "SELECT * FROM TicketRelationships WHERE (Ticket1ID = @Ticket1ID AND Ticket2ID = @Ticket2ID) OR (Ticket1ID = @Ticket2ID AND Ticket2ID = @Ticket1ID)";
                command.CommandType = CommandType.Text;
                command.Parameters.AddWithValue("Ticket1ID", ticket1ID);
                command.Parameters.AddWithValue("Ticket2ID", ticket2ID);
                items.Fill(command);
            }
            if (items.IsEmpty)
            {
                return(null);
            }
            return(items[0]);
        }
Пример #3
0
 public TicketRelationship(DataRow row, TicketRelationships ticketRelationships) : base(row, ticketRelationships)
 {
     _ticketRelationships = ticketRelationships;
 }