コード例 #1
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();
            }
        }
コード例 #2
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";
        }
コード例 #3
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";
        }
コード例 #4
0
        public void ShowLotNumbers()
        {   //Takes Care of Loading the DataGridView with all Active Quotes
            dgActiveWOR.DataSource = null;
            Classes.DataAccess.PurchasingDataAccess db = new Classes.DataAccess.PurchasingDataAccess();
            activeLotNumbers = db.GetLotNumbers();

            dgActiveWOR.DataSource = activeLotNumbers;

            dgActiveWOR.Columns["LotID"].Visible           = false;
            dgActiveWOR.Columns["OrderQuantity"].Visible   = false;
            dgActiveWOR.Columns["PartDescription"].Visible = false;
            dgActiveWOR.Columns["JobDueDate"].Visible      = false;
            dgActiveWOR.Columns["MasterDueDate"].Visible   = false;
            dgActiveWOR.Columns["TurnTime"].Visible        = false;
            dgActiveWOR.Columns["Consigned"].Visible       = false;
            dgActiveWOR.Columns["JobComments"].Visible     = false;

            dgActiveWOR.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
            dgActiveWOR.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
コード例 #5
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;
        }