private void Orders_Load(object sender, EventArgs e) { films = new FilmsContainer(); CreateHeaderTable(dataGridView1); LoadTable(dataGridView1, films.Ords.ToList()); //dataGridView1.ColumnCount = 5; //dataGridView1.RowCount = films.Orders.Count()+1; //int row = 0; //dataGridView1.Rows[row].Cells[0].Value = "Name"; //dataGridView1.Rows[row].Cells[1].Value = "Phone"; //dataGridView1.Rows[row].Cells[2].Value = "Name"; //dataGridView1.Rows[row].Cells[3].Value = "Status"; //dataGridView1.Rows[row].Cells[4].Value = "id"; //List<User> us = films.Users.ToList(); //List<Film> fs = films.Films1.ToList(); //foreach (Ord ord in films.Ords) //{ // row++; // User u = us.FindLast(x => x.IdUser == ord.IdUser); // Film f = fs.FindLast(x => x.IdFilm == ord.IdFilm); // dataGridView1.Rows[row].Cells[0].Value = u.Name; // dataGridView1.Rows[row].Cells[1].Value = u.Phone; // dataGridView1.Rows[row].Cells[2].Value = f.Name; // dataGridView1.Rows[row].Cells[3].Value = ord.Status; // dataGridView1.Rows[row].Cells[4].Value = ord.IdOrder; //} }
private void Form1_Load(object sender, EventArgs e) { showButtons(); films = new FilmsContainer(); current = films.Films1.ToList().FindAll(x => (x.FinishRental >= DateTime.Now)); CreateHeaderTable(dataGridView1); LoadTable(dataGridView1, current); }
private void btnAddFilm_Click(object sender, EventArgs e) { AddSession f = new AddSession(); f.ShowDialog(); f.Close(); films = new FilmsContainer(); current = films.Films1.ToList().FindAll(x => (x.FinishRental >= DateTime.Now)); LoadTable(dataGridView1, current); }