Esempio n. 1
0
 private void ReloadData(ref ListExh list)
 {
     for (var i = 0; i < list.exhibitions.Count; i++)
     {
         dataExhibitions.Rows.Add(list.exhibitions[i].Author, list.exhibitions[i].Type, list.exhibitions[i].Genre);
     }
 }
Esempio n. 2
0
 public ViewExhibitions()
 {
     InitializeComponent();
     db   = new DB();
     list = new ListExh();
     db.LoadData(ref list);
     ReloadData(ref list);
 }
 public WorkWithExhibitionsForm()
 {
     InitializeComponent();
     db          = new DB();
     list        = new ListExh();
     dataGridExh = dataExh;
     db.LoadData(ref list);
     ReloadData(ref list);
 }
Esempio n. 4
0
        public void LoadData(ref ListExh list)
        {
            list.exhibitions.Clear();
            OpenConnect();
            string          query   = "SELECT * FROM `exhibitions`";
            MySqlCommand    command = new MySqlCommand(query, GetConnection());
            MySqlDataReader reader  = command.ExecuteReader();

            while (reader.Read())
            {
                list.exhibitions.Add(new Exhibition(reader[1].ToString(), reader[2].ToString(), reader[3].ToString()));
            }
            reader.Close();
            CloseConnect();
        }