private void SalesByMachineProduct_Click(object sender, EventArgs e) { List <Transactions> data; List <Machine> machineList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportSalesByProductPerMachine(data, machineList); Export export = new Export(); export.ExportToCSV(subtotals, "SalesMachineProductGrid.csv"); CSVCreatedDialog csvOK = new CSVCreatedDialog(); csvOK.Show(); }
private void SalesByMachineProduct_Click(object sender, EventArgs e) { List<Transactions> data; List<Machine> machineList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportSalesByProductPerMachine(data, machineList); Export export = new Export(); export.ExportToCSV(subtotals, "SalesMachineProductGrid.csv"); CSVCreatedDialog csvOK = new CSVCreatedDialog(); csvOK.Show(); }
//Report TABS ==> load data on tab change private void ReportTabs_SelectedIndexChanged(object sender, EventArgs e) { if (ReportTabs.SelectedTab == SalesProduct) { List <Transactions> data; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); DataTable subtotals = report.reportSalesByItem(data); SalesProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == InventoryProduct) { List <Product> data; ReportManager report = new ReportManager(); data = this.database.SelectAllProduct(); DataTable subtotals = report.reportInventoryCostItem(data); InventoryProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == SalesMachine) { List <Transactions> data; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); DataTable subtotals = report.reportSalesByMachine(data); SalesMachineGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == ReportsMachineProduct) { List <Transactions> data; List <Machine> machineList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportSalesByProductPerMachine(data, machineList); SalesMachineProductGrid.CellBorderStyle = DataGridViewCellBorderStyle.None; SalesMachineProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == SalesCityMachine) { List <Transactions> data; List <Machine> machineList; List <City> cityList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); cityList = this.database.SelectAllCity(); DataTable subtotals = report.reportSalesByCity(data, machineList, cityList); SalesCityMachineGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == RestockMachine) { List <Machine> machineList; ReportManager report = new ReportManager(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportRestockByMachine(machineList); RestockMachineGrid.DataSource = subtotals; } }
//Report TABS ==> load data on tab change private void ReportTabs_SelectedIndexChanged(object sender, EventArgs e) { if (ReportTabs.SelectedTab == SalesProduct) { List<Transactions> data; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); DataTable subtotals = report.reportSalesByItem(data); SalesProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == InventoryProduct) { List<Product> data; ReportManager report = new ReportManager(); data = this.database.SelectAllProduct(); DataTable subtotals = report.reportInventoryCostItem(data); InventoryProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == SalesMachine) { List<Transactions> data; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); DataTable subtotals = report.reportSalesByMachine(data); SalesMachineGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == ReportsMachineProduct) { List<Transactions> data; List<Machine> machineList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportSalesByProductPerMachine(data, machineList); SalesMachineProductGrid.CellBorderStyle = DataGridViewCellBorderStyle.None; SalesMachineProductGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == SalesCityMachine) { List<Transactions> data; List<Machine> machineList; List<City> cityList; ReportManager report = new ReportManager(); data = this.database.SelectAllTransactions(); machineList = this.database.SelectAllMachine(); cityList = this.database.SelectAllCity(); DataTable subtotals = report.reportSalesByCity(data, machineList, cityList); SalesCityMachineGrid.DataSource = subtotals; } else if (ReportTabs.SelectedTab == RestockMachine) { List<Machine> machineList; ReportManager report = new ReportManager(); machineList = this.database.SelectAllMachine(); DataTable subtotals = report.reportRestockByMachine(machineList); RestockMachineGrid.DataSource = subtotals; } }