예제 #1
0
        //Functions----------------------------------------------------------------------------------

        private void updateData(object sender, EventArgs e)
        {
            dgTaskView.DataSource = null;
            Classes.DataAccess.SalesDataAccess db = new Classes.DataAccess.SalesDataAccess();
            MasterReviewRequests = db.GetMasterReviewRequests();

            dgTaskView.DataSource = MasterReviewRequests;
            dgTaskView.Columns["Owner"].Visible = false;

            dgTaskView.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
            dgTaskView.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
예제 #2
0
        public void populate(object sender, EventArgs e)
        {
            dgActiveWORs.Enabled = false;

            //Get Current Selection Location
            if (dgActiveWORs.CurrentCell != null)
            {
                if (dgActiveWORs.CurrentCell.ColumnIndex > 0)
                {
                    WORactiveRow    = dgActiveWORs.CurrentCell.RowIndex;
                    WORactiveColumn = dgActiveWORs.CurrentCell.ColumnIndex;
                }
            }

            //Load DataGridView
            Classes.DataAccess.DashboardDataAccess db = new Classes.DataAccess.DashboardDataAccess();
            engineeringDashboard    = db.LoadDashboard(ckQuotes.Checked, ckWORs.Checked);
            dgActiveWORs.DataSource = engineeringDashboard;

            Classes.StatusCalculation calculatedStatus = new Classes.StatusCalculation();
            calculatedStatus.CalculateDashboard(engineeringDashboard);

            //Format DataGridView
            formatDataGrids();

            //Re-set Current Cell
            try
            {
                dgActiveWORs.CurrentCell = dgActiveWORs.Rows[WORactiveRow].Cells[WORactiveColumn];
            }
            catch { }

            dgActiveWORs.Enabled = true;


            //Task View Stuff
            dgTaskView.Enabled = false;

            //Get Current Selection Location
            if (dgTaskView.CurrentCell != null)
            {
                if (dgTaskView.CurrentCell.ColumnIndex > 0)
                {
                    TaskActiveRow    = dgTaskView.CurrentCell.RowIndex;
                    TaskActiveColumn = dgTaskView.CurrentCell.ColumnIndex;
                }
            }

            //Task View Handler
            dgTaskView.DataSource = null;
            Classes.DataAccess.SalesDataAccess dbSales = new Classes.DataAccess.SalesDataAccess();
            MasterReviewRequests  = dbSales.GetMasterReviewRequests();
            dgTaskView.DataSource = MasterReviewRequests;

            //Format Task View Data Grid
            dgTaskView.Columns["Owner"].Visible    = false;
            dgTaskView.Columns["SuperHot"].Visible = false;

            //Re-Select Current Cell
            try
            {
                dgTaskView.CurrentCell = dgTaskView.Rows[TaskActiveRow].Cells[TaskActiveColumn];
            }
            catch { }

            dgTaskView.Enabled = true;

            dgTaskView.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
            dgTaskView.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }