private void BTNTop10_Click(object sender, EventArgs e) { // För att se hur detta fungerar, gå till StatsForm-klassens dokumentation. StatsForm statsForm = new StatsForm(); statsForm.DrawTop10Graph(productController.GetAll(), receiptController.GetAll()); statsForm.Show(); }
private void BTNViewSales_Click(object sender, EventArgs e) { // För att se hur detta fungerar, gå till StatsForm-klassens dokumentation. Product selectedProduct = GetSelectedProductFromListView(ListViewProducts); if (selectedProduct != null) { List <Receipt> receiptsFound = receiptController.GetAllBetweenDates( DateTimePickerFrom.Value.ToString("yyyyMMdd"), DateTimePickerTo.Value.ToString("yyyyMMdd")); StatsForm statsForm = new StatsForm(); statsForm.DrawSalesGraph(selectedProduct, receiptsFound); statsForm.Show(); } else { MessageBox.Show("Select a product to view sales."); } }