예제 #1
0
 //CITY TABS ==> load data on tab change
 private void CityTabs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CityTabs.SelectedTab == CityList)
     {
         this.LoadCityMachinesDataGrid();
     }
     else if (CityTabs.SelectedTab == RevenueByCity)
     {
         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.reportRevenueByCity(data, machineList, cityList);
         CityTotalRevenueDataGrid.DataSource = subtotals;
     }
     else if (CityTabs.SelectedTab == ItemSalesByCity)
     {
         List <Transactions> data;
         List <City>         cities;
         List <Machine>      machines;
         ReportManager       report = new ReportManager();
         data     = this.database.SelectAllTransactions();
         cities   = this.database.SelectAllCity();
         machines = this.database.SelectAllMachine();
         DataTable source = report.reportSalesByCityAndItem(data, cities, machines);
         CitySalesByItemDataGrid.DataSource = source;
     }
 }
예제 #2
0
        private void StartUp_Load(object sender, EventArgs e)
        {
            List <Product> data;
            ReportManager  report = new ReportManager();

            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);

            ProductWarehouseDataGrid.DataSource = source;

            this.LoadCityMachinesDataGrid();

            List <Machine> data2;

            data2 = this.database.SelectAllMachine();
            MachineListAllDataGrid.DataSource = data2;

            List <Transactions> data3;
            ReportManager       report2 = new ReportManager();

            data3 = this.database.SelectAllTransactions();
            DataTable subtotals = report2.reportSalesByItem(data3);

            SalesProductGrid.DataSource = subtotals;

            treeView1.ExpandAll();
            treeView2.ExpandAll();
        }
        public void LoadWarehouseTransferGridView()
        {
            WarehouseTransferGridView.DataSource = null;
            WarehouseTransferGridView.Update();
            WarehouseTransferGridView.Refresh();

            List<Product> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);
            WarehouseTransferGridView.DataSource = source;
        }
        public void LoadMachineTransferGridView()
        {
            MachineTransferGridView.DataSource = null;
            MachineTransferGridView.Update();
            MachineTransferGridView.Refresh();

            List<Machine> data = new List<Machine>();
            data.Add(machine);
            ReportManager report = new ReportManager();
            DataTable source = report.reportProductPriceByMachine(data);
            MachineTransferGridView.DataSource = source;
        }
예제 #5
0
        private void button11_Click(object sender, EventArgs e)
        {
            List<Product> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllProduct();

            DataTable subtotals = report.reportInventoryCostItem(data);

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();
            csvOK.Show();
        }
예제 #6
0
        //
        // Load/Refresh Full Datagrid views
        //
        public void LoadProductWarehouseDataGrid()
        {
            ProductWarehouseDataGrid.DataSource = null;
            ProductWarehouseDataGrid.Update();
            ProductWarehouseDataGrid.Refresh();

            List <Product> data;
            ReportManager  report = new ReportManager();

            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);

            ProductWarehouseDataGrid.DataSource = source;
        }
        public void LoadWarehouseTransferGridView()
        {
            WarehouseTransferGridView.DataSource = null;
            WarehouseTransferGridView.Update();
            WarehouseTransferGridView.Refresh();

            List <Product> data;
            ReportManager  report = new ReportManager();

            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);

            WarehouseTransferGridView.DataSource = source;
        }
        public void LoadMachineTransferGridView()
        {
            MachineTransferGridView.DataSource = null;
            MachineTransferGridView.Update();
            MachineTransferGridView.Refresh();

            List <Machine> data = new List <Machine>();

            data.Add(machine);
            ReportManager report = new ReportManager();
            DataTable     source = report.reportProductPriceByMachine(data);

            MachineTransferGridView.DataSource = source;
        }
예제 #9
0
        private void RestockByMachineCSV_Click(object sender, EventArgs e)
        {
            List <Machine> machineList;
            ReportManager  report = new ReportManager();

            machineList = this.database.SelectAllMachine();
            DataTable subtotals = report.reportRestockByMachine(machineList);

            Export export = new Export();

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();

            csvOK.Show();
        }
예제 #10
0
 //MACHINE TABS ==> load data on tab change
 private void MachineTabs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (MachineTabs.SelectedTab == AllMachines)
     {
         List <Machine> data;
         data = this.database.SelectAllMachine();
         MachineListAllDataGrid.DataSource = data;
     }
     else if (MachineTabs.SelectedTab == ItemsByMachine)
     {
         List <Machine> data;
         data = this.database.SelectAllMachine();
         ReportManager report = new ReportManager();
         DataTable     source = report.reportProductByMachine(data);
         MachineProductItemsDataGrid.DataSource = source;
     }
 }
예제 #11
0
        private void button11_Click(object sender, EventArgs e)
        {
            List <Product> data;
            ReportManager  report = new ReportManager();

            data = this.database.SelectAllProduct();

            DataTable subtotals = report.reportInventoryCostItem(data);

            Export export = new Export();

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();

            csvOK.Show();
        }
예제 #12
0
        private void button13_Click(object sender, EventArgs e)
        {
            List <Transactions> data;
            ReportManager       report = new ReportManager();

            data = this.database.SelectAllTransactions();

            DataTable subtotals = report.reportSalesByMachine(data);

            Export export = new Export();

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();

            csvOK.Show();
        }
예제 #13
0
        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 ChartSalesByProduct_Load(object sender, EventArgs e)
        {
            List<Transactions> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllTransactions();
            DataTable subtotals = report.reportSalesByItem(data);

            SalesByProduct.DataSource = subtotals;

            SalesByProduct.Titles.Add("Net Profit by Product");

            string productName = subtotals.Columns[0].ToString();
            SalesByProduct.Series["Series 1"].XValueMember = productName;

            string netProfit = subtotals.Columns[1].ToString();
            SalesByProduct.Series["Series 1"].YValueMembers = netProfit;

            SalesByProduct.DataBind();
        }
예제 #15
0
        private void ChartSalesByProduct_Load(object sender, EventArgs e)
        {
            List <Transactions> data;
            ReportManager       report = new ReportManager();

            data = this.database.SelectAllTransactions();
            DataTable subtotals = report.reportSalesByItem(data);

            SalesByProduct.DataSource = subtotals;

            SalesByProduct.Titles.Add("Net Profit by Product");

            string productName = subtotals.Columns[0].ToString();

            SalesByProduct.Series["Series 1"].XValueMember = productName;

            string netProfit = subtotals.Columns[1].ToString();

            SalesByProduct.Series["Series 1"].YValueMembers = netProfit;

            SalesByProduct.DataBind();
        }
예제 #16
0
        //
        // Load/Refresh Full Datagrid views
        //
        public void LoadProductWarehouseDataGrid()
        {
            ProductWarehouseDataGrid.DataSource = null;
            ProductWarehouseDataGrid.Update();
            ProductWarehouseDataGrid.Refresh();

            List<Product> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);
            ProductWarehouseDataGrid.DataSource = source;
        }
예제 #17
0
        private void StartUp_Load(object sender, EventArgs e)
        {
            List<Product> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllProduct();
            DataTable source = report.reportProductWarehouse(data);
            ProductWarehouseDataGrid.DataSource = source;

            this.LoadCityMachinesDataGrid();

            List<Machine> data2;
            data2 = this.database.SelectAllMachine();
            MachineListAllDataGrid.DataSource = data2;

            List<Transactions> data3;
            ReportManager report2 = new ReportManager();
            data3 = this.database.SelectAllTransactions();
            DataTable subtotals = report2.reportSalesByItem(data3);
            SalesProductGrid.DataSource = subtotals;

            treeView1.ExpandAll();
            treeView2.ExpandAll();
        }
예제 #18
0
        private void CSVSalesByProduct_Click(object sender, EventArgs e)
        {
            List<Transactions> data;
            ReportManager report = new ReportManager();
            data = this.database.SelectAllTransactions();

            DataTable subtotals = report.reportSalesByItem(data);

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();
            csvOK.Show();
        }
예제 #19
0
 //CITY TABS ==> load data on tab change
 private void CityTabs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CityTabs.SelectedTab == CityList)
     {
         this.LoadCityMachinesDataGrid();
     }
     else if (CityTabs.SelectedTab == RevenueByCity)
     {
         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.reportRevenueByCity(data, machineList, cityList);
         CityTotalRevenueDataGrid.DataSource = subtotals;
     }
     else if (CityTabs.SelectedTab == ItemSalesByCity)
     {
         List<Transactions> data;
         List<City> cities;
         List<Machine> machines;
         ReportManager report = new ReportManager();
         data = this.database.SelectAllTransactions();
         cities = this.database.SelectAllCity();
         machines = this.database.SelectAllMachine();
         DataTable source = report.reportSalesByCityAndItem(data, cities, machines);
         CitySalesByItemDataGrid.DataSource = source;
     }
 }
예제 #20
0
 //MACHINE TABS ==> load data on tab change
 private void MachineTabs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (MachineTabs.SelectedTab == AllMachines)
     {
         List<Machine> data;
         data = this.database.SelectAllMachine();
         MachineListAllDataGrid.DataSource = data;
     }
     else if (MachineTabs.SelectedTab == ItemsByMachine)
     {
         List<Machine> data;
         data = this.database.SelectAllMachine();
         ReportManager report = new ReportManager();
         DataTable source = report.reportProductByMachine(data);
         MachineProductItemsDataGrid.DataSource = source;
     }
 }
예제 #21
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;
            }
        }
예제 #22
0
        private void RestockByMachineCSV_Click(object sender, EventArgs e)
        {
            List<Machine> machineList;
            ReportManager report = new ReportManager();
            machineList = this.database.SelectAllMachine();
            DataTable subtotals = report.reportRestockByMachine(machineList);

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

            CSVCreatedDialog csvOK = new CSVCreatedDialog();
            csvOK.Show();
        }
예제 #23
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;
            }
        }
예제 #24
0
        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();
        }