private void MainForm_Load(object sender, EventArgs e) { Books = _database.GetBooks(); GuiHelpers.RefreshBooksPanel(Books, booksPanelListView); Requests = _database.GetRequests(); GuiHelpers.RefreshRequestsPanel(Requests, requestsPanelListView); GuiHelpers.MakePanelActive(booksPanel, ordersPanel, requestsPanel); GuiHelpers.MakeBtnActive(booksPanelBtn, ordersPanelBtn, requestsPanelBtn); if (CurrUser.IsAdmin) { userInfoLabel.Text = "Welcome, Admin " + CurrUser.Username; addBookBtn.Visible = true; delRequestBtn.Visible = true; Orders = _database.GetOrders(); GuiHelpers.RefreshOrdersPanel(Orders, ordersPanelListView); ordersPanelBtn.Text = " All Orders"; } else { userInfoLabel.Text = "Welcome, " + CurrUser.Username; Orders = _database.GetOrdersByUsername(CurrUser.Username); GuiHelpers.RefreshOrdersPanel(Orders, ordersPanelListView); ordersPanelListView.Columns[1].Width = 0; ordersPanelBtn.Text = " My Orders"; } }
private void requestsPanelBtn_Click(object sender, EventArgs e) { GuiHelpers.MakeBtnActive(requestsPanelBtn, booksPanelBtn, ordersPanelBtn); GuiHelpers.MakePanelActive(requestsPanel, booksPanel, ordersPanel); }