Пример #1
0
        public List <InterventionType> GetListOfInterventionType()
        {
            if (connection.State == System.Data.ConnectionState.Closed)
            {
                connection.Open();
            }
            List <InterventionType> listInterventionTypes = new List <InterventionType>();
            InterventionType        interventionType;
            string selectCommand = $@"SELECT InterventionTypeName FROM interventiontype;";

            command = new MySqlCommand(selectCommand, connection);
            var reader = command.ExecuteReader();

            if (reader.HasRows)
            {
                int counter = 0;
                while (reader.Read())
                {
                    interventionType      = new InterventionType();
                    interventionType.Type = reader.GetString(0);
                    listInterventionTypes.Add(interventionType);
                    counter++;
                }
            }
            reader.Close();
            connection.Close();
            return(listInterventionTypes);
        }
 public Intervention(Client client, Intervenant intervenant, InterventionType interventionType)
 {
     this.client           = client;
     this.intervenant      = intervenant;
     this.interventionType = interventionType;
 }