Ejemplo n.º 1
0
        //Physical Events-----------------------------------------------------------------------------------------------

        private void btnRequestPartsReview_Click(object sender, EventArgs e)
        {
            string            message = "Would you like to request a Parts Review for Job Number " + dgActiveQuotes.Rows[quoteRow].Cells[0].Value.ToString() + "?";
            string            caption = "Are you sure?";
            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult      result;

            // Displays the MessageBox.

            result = MessageBox.Show(message, caption, buttons);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                //Create a new db connection
                Classes.DataAccess.SalesDataAccess db = new Classes.DataAccess.SalesDataAccess();

                //Set PartsReviewRequest to True, PartsReviewInProgress and PartsReviewComplete to False
                db.requestPartsReview(dgActiveQuotes.Rows[quoteRow].Cells[0].Value.ToString());

                //Load Temp Lot Task for status calc
                Classes.LotTask tempLotTask = new Classes.LotTask();

                tempLotTask.JobWOR = Int32.Parse(dgActiveQuotes.Rows[quoteRow].Cells[0].Value.ToString());
                tempLotTask.Lot    = 0;

                //Update Quote Current Status
                Classes.StatusCalculation getStatus = new Classes.StatusCalculation();
                getStatus.CalculateStatus(tempLotTask);

                //Refresh
                ShowActiveQuotes();
            }
        }
Ejemplo n.º 2
0
        private void btnStencilsReceived_Click(object sender, EventArgs e)
        {
            string            message = "Did you receive the stencil(s) for Job Number: " + dgActiveWOR.Rows[quoteRow].Cells[1].Value.ToString() + "/" + dgActiveWOR.Rows[quoteRow].Cells[2].Value.ToString() + "?";
            string            caption = "Are you sure?";
            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult      result;

            // Displays the MessageBox.

            result = MessageBox.Show(message, caption, buttons);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                //Create a new db connection
                Classes.DataAccess.PurchasingDataAccess db = new Classes.DataAccess.PurchasingDataAccess();

                //Set PartsReceived = True
                db.StencilsReceived(dgActiveWOR.Rows[quoteRow].Cells[1].Value.ToString(), dgActiveWOR.Rows[quoteRow].Cells[2].Value.ToString());

                //Load Temp Lot Task for status calc
                Classes.LotTask tempLotTask = new Classes.LotTask();

                tempLotTask.JobWOR = Int32.Parse(dgActiveWOR.Rows[quoteRow].Cells[1].Value.ToString());
                tempLotTask.Lot    = Int32.Parse(dgActiveWOR.Rows[quoteRow].Cells[2].Value.ToString());

                //Update Quote Current Status
                Classes.StatusCalculation getStatus = new Classes.StatusCalculation();
                getStatus.CalculateStatus(tempLotTask);

                //Refresh
                ShowLotNumbers();
            }
        }
Ejemplo n.º 3
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            //Grab an Instance of SalesDataAccess
            Classes.DataAccess.SalesDataAccess db = new Classes.DataAccess.SalesDataAccess();

            //Prepare currentTask
            Classes.LotTask currentTask = new Classes.LotTask();
            currentTask.JobWOR = Int32.Parse(dgTaskView[0, activeRow].Value.ToString());
            currentTask.Lot    = Int32.Parse(dgTaskView[1, activeRow].Value.ToString());

            //Update LotStatus and Time-stamp LotTimeTracking.MasterReviewEnd
            db.UpdateReviewMasterComplete(currentTask);

            //Re-Calculate the JobStatus
            Classes.StatusCalculation getStatus = new Classes.StatusCalculation();
            getStatus.CalculateStatus(currentTask);

            //Update the GridView
            updateData(null, null);

            //Reset Buttons
            btnStart.Enabled = false;
            btnStart.Visible = true;
            btnStart.Text    = "Start";
            btnEnd.Enabled   = false;
            btnEnd.Visible   = false;
            btnEnd.Text      = "End";
        }
Ejemplo n.º 4
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            //Grab an Instance of SalesDataAccess
            Classes.DataAccess.PurchasingDataAccess db = new Classes.DataAccess.PurchasingDataAccess();

            //Prepare currentTask
            Classes.LotTask currentTask = new Classes.LotTask();
            currentTask.JobWOR = Int32.Parse(dgTaskView[0, activeRow].Value.ToString());
            currentTask.Lot    = Int32.Parse(dgTaskView[1, activeRow].Value.ToString());

            switch (dgTaskView[3, activeRow].Value.ToString())
            {
            case "Parts Review In Progress":
                //Set PartsReviewComplete=True, PartsReviewRequest=False, PartsReviewInProgress=False; Eventually, Time-Tracking will happen here too...
                db.UpdatePartsReviewComplete(currentTask);

                break;
            }

            //Re-Calculate the JobStatus
            Classes.StatusCalculation getStatus = new Classes.StatusCalculation();
            getStatus.CalculateStatus(currentTask);

            //Update the GridView
            populate(null, null);

            //Reset Buttons
            btnStart.Enabled = false;
            btnStart.Visible = true;
            btnStart.Text    = "Start";
            btnEnd.Enabled   = false;
            btnEnd.Visible   = false;
            btnEnd.Text      = "End";
        }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            //Grab an Instance of PurchasingDataAccess
            Classes.DataAccess.PurchasingDataAccess db = new Classes.DataAccess.PurchasingDataAccess();
            //Prepare currentTask
            Classes.LotTask currentTask = new Classes.LotTask();
            currentTask.JobWOR = Int32.Parse(dgTaskView[0, activeRow].Value.ToString());
            currentTask.Lot    = Int32.Parse(dgTaskView[1, activeRow].Value.ToString());

            switch (dgTaskView[3, activeRow].Value.ToString())
            {
            case "Parts Review Requested":
                //Change the PartsReviewInProgress Flag to True
                db.UpdatePartsReviewInProgress(currentTask);

                break;

            case "Order Parts":
                //Change the PartsOrdered Flag to True and Time-Stamp LotTimeTracking.PartsOrderedDate
                db.UpdatePartsOrdered(currentTask);

                break;

            case "Order PCBs":
                //Change the PCBOrdered Flag to True and Time-Stamp LotTimeTracking.PCBOrderDate
                db.UpdatePCBOrdered(currentTask);

                break;

            case "Order Stencils":
                //Change the StencilsOrdered Flag to True and Time-Stamp LotTimeTracking.StencilOrderDate
                db.UpdateStencilsOrdered(currentTask);

                break;
            }

            //Re-Calculate the JobStatus
            Classes.StatusCalculation getStatus = new Classes.StatusCalculation();
            getStatus.CalculateStatus(currentTask);

            //Update the GridView
            populate(null, null);

            //Reset Buttons
            btnStart.Enabled = false;
            btnStart.Visible = true;
            btnStart.Text    = "Start";
            btnEnd.Enabled   = false;
            btnEnd.Visible   = false;
            btnEnd.Text      = "End";
        }
Ejemplo n.º 7
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();
            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;
        }