Exemple #1
0
        //Populate Helper Tasks------------------------------------------------------------------------------------------

        private void loadActiveWORs()
        {
            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
            formatDataGrid();

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

            dgActiveWORs.Enabled = true;
        }
Exemple #2
0
        private void dgActiveWORs_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            string tempComment = "";
            string tempType    = ""; //Quote or WOR
            string tempWOR     = "";
            string tempLot     = "";

            Classes.DataAccess.DashboardDataAccess db = new Classes.DataAccess.DashboardDataAccess();

            //Store Comment
            tempComment = dgActiveWORs.Rows[e.RowIndex].Cells["Comments"].Value.ToString();
            tempType    = dgActiveWORs.Rows[e.RowIndex].Cells["QuoteOrWOR"].Value.ToString();
            tempWOR     = dgActiveWORs.Rows[e.RowIndex].Cells["WOR"].Value.ToString();
            tempLot     = dgActiveWORs.Rows[e.RowIndex].Cells["Lot"].Value.ToString();

            db.UpdateComments(tempComment, tempType, tempWOR, tempLot);

            //Start Timer
            timer.Start();
        }
        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();
            purchasingDashboard     = db.LoadDashboard(ckQuotes.Checked, ckWORs.Checked);
            dgActiveWORs.DataSource = purchasingDashboard;

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

            //Format DataGridView
            formatDataGrid();

            //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;
                }
            }

            Classes.DataAccess.PurchasingDataAccess dbPur = new Classes.DataAccess.PurchasingDataAccess();
            TaskRequests          = dbPur.GetPurchasingTaskList();
            dgTaskView.DataSource = TaskRequests;

            //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;
        }