Example #1
0
        private static model.Type createType(SqlDataReader data)
        {
            int    id   = SqlDataReaderUtils.GetValue <int>(data, 0);
            string name = SqlDataReaderUtils.GetValue <string>(data, 1);

            return(new model.Type(id, name));
        }
Example #2
0
        private static Client createClient(SqlDataReader data)
        {
            int    id    = SqlDataReaderUtils.GetValue <int>(data, 0);
            string name  = SqlDataReaderUtils.GetValue <string>(data, 1);
            string email = SqlDataReaderUtils.GetValue <string>(data, 2);

            return(new Client(id, name, email));
        }
Example #3
0
        private static Admin createAdmin(SqlDataReader data)
        {
            int    id    = SqlDataReaderUtils.GetValue <int>(data, 0);
            string name  = SqlDataReaderUtils.GetValue <string>(data, 1);
            string email = SqlDataReaderUtils.GetValue <string>(data, 2);

            return(new Admin(id, name, email));
        }
Example #4
0
        private static Step createStep(SqlDataReader data)
        {
            int    num_order   = SqlDataReaderUtils.GetValue <int>(data, 0);
            string description = SqlDataReaderUtils.GetValue <string>(data, 1);
            int    id_type     = SqlDataReaderUtils.GetValue <int>(data, 2);

            return(new Step(num_order, description, id_type));
        }
Example #5
0
        private static model.Action createAction(SqlDataReader data)
        {
            DateTime            created_at = SqlDataReaderUtils.GetValue <DateTime>(data, 1);
            Nullable <DateTime> ended_at   = SqlDataReaderUtils.GetValue <DateTime>(data, 2);
            string note       = SqlDataReaderUtils.GetValue <String>(data, 3);
            int    ticket_id  = SqlDataReaderUtils.GetValue <int>(data, 4);
            int    admin_id   = SqlDataReaderUtils.GetValue <int>(data, 5);
            int    step_order = SqlDataReaderUtils.GetValue <int>(data, 6);
            int    id_type    = SqlDataReaderUtils.GetValue <int>(data, 7);

            return(new model.Action(created_at, ended_at.Equals(default(DateTime))?null:ended_at, note, ticket_id, admin_id, step_order, id_type));
        }
Example #6
0
        private static Request createRequest(SqlDataReader data)
        {
            int      id            = SqlDataReaderUtils.GetValue <int>(data, 0);
            DateTime created_at    = SqlDataReaderUtils.GetValue <DateTime>(data, 1);
            DateTime?response_date = SqlDataReaderUtils.GetValue <DateTime>(data, 2);
            string   response      = SqlDataReaderUtils.GetValue <string>(data, 3);
            int      ticket_id     = SqlDataReaderUtils.GetValue <int>(data, 4);
            int      client_id     = SqlDataReaderUtils.GetValue <int>(data, 5);
            int?     admin_id      = SqlDataReaderUtils.GetValue <int>(data, 6);

            return(new Request(id, created_at, response_date.Equals(default(DateTime)) ? null : response_date,
                               response, ticket_id, client_id, admin_id.Equals(default(int))?null:admin_id));
        }
Example #7
0
        private static Ticket createTicket(SqlDataReader data)
        {
            int      code        = SqlDataReaderUtils.GetValue <int>(data, 0);
            string   state       = SqlDataReaderUtils.GetValue <string>(data, 1);
            string   description = SqlDataReaderUtils.GetValue <string>(data, 2);
            DateTime created_at  = SqlDataReaderUtils.GetValue <DateTime>(data, 3);
            DateTime?closed_at   = SqlDataReaderUtils.GetValue <DateTime>(data, 4);
            string   priority    = SqlDataReaderUtils.GetValue <string>(data, 5);
            DateTime?deleted_at  = SqlDataReaderUtils.GetValue <DateTime>(data, 6);
            int      admin_id    = SqlDataReaderUtils.GetValue <int>(data, 7);
            int      client_id   = SqlDataReaderUtils.GetValue <int>(data, 8);
            int?     id_type     = SqlDataReaderUtils.GetValue <int>(data, 9);

            return(new Ticket(code, state, description,
                              created_at, closed_at.Equals(default(DateTime))?null:closed_at,
                              priority, deleted_at.Equals(default(DateTime))?null:deleted_at, admin_id,
                              client_id, id_type.Equals(default(DateTime))?null:id_type));
        }