// Конструктор при открытии уже существующего списка public TableOfList(string login, Autorization autorization, string ID, string creator, string name) { InitializeComponent(); startForm = autorization; username = login; this.ID = ID; this.name = name; this.creator = creator; List <List> temp = new List <List>(); files.ReadFromFile(ID, ref temp); int countRows = 0; foreach (List product in temp) { productsTable.Rows.Add(); productsTable.Rows[countRows].Cells[0].Value = product.checkedProduct; productsTable.Rows[countRows].Cells[1].Value = product.productName; productsTable.Rows[countRows].Cells[2].Value = product.productCount; productsTable.Rows[countRows].Cells[3].Value = product.cost; productsTable.Rows[countRows].Cells[4].Value = product.shopName; countRows++; } }
private void MainForm_Load(object sender, EventArgs e) { files.ReadFromFile(username, ref userLists); TableRefresh(); }