Esempio n. 1
0
        private void SalesByCityCSV_Click(object sender, EventArgs e)
        {
            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);

            Export export = new Export();

            export.ExportToCSV(subtotals, "SalesCityMachineGrid.csv");

            CSVCreatedDialog csvOK = new CSVCreatedDialog();

            csvOK.Show();
        }
Esempio n. 2
0
        private void SalesByCityCSV_Click(object sender, EventArgs e)
        {
            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);

            Export export = new Export();
            export.ExportToCSV(subtotals, "SalesCityMachineGrid.csv");

            CSVCreatedDialog csvOK = new CSVCreatedDialog();
            csvOK.Show();
        }
Esempio n. 3
0
        //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;
            }
        }
Esempio n. 4
0
        //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;
            }
        }