Exemplo n.º 1
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            // go to status page with job, partNo and customer
            if (partNoLabel.Text.Trim().Length == 0)
            {
                return;
            }

            // calculate the type of form to create after
            string type = string.Empty;

            if (question3YesRadioButton.Checked || question4YesRadioButton.Checked ||
                question5YesRadioButton.Checked || question6YesRadioButton.Checked)
            {
                type = "Contract Review";
            }
            else if (!question3YesRadioButton.Checked || !question4YesRadioButton.Checked ||
                     !question5YesRadioButton.Checked || !question6YesRadioButton.Checked)
            {
                if (question1NewRadioButton.Checked)
                {
                    type = "Quick Release";
                }
                else if (question1ActiveRadioButton.Checked || question1CompleteRadioButton.Checked)
                {
                    type = "Nothing";
                }
            }


            if (this.Modal)
            {
                // submit query info: TOD_DO

                this.Close();
            }
            else
            {
                // load status page
                this.Hide();
                Form statusForm = new StatusPage(jobNo, partNoLabel.Text.Trim(), "ROLLS", type);
                statusForm.FormClosed += (s, args) => this.Close();
                statusForm.Show();
            }
        }
Exemplo n.º 2
0
        private void dataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            // check that the cell is valid
            if (e == null)
            {
                return;
            }
            if (dataGridView.Rows[e.RowIndex].Cells[0].Value == null || dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString().Trim().Length == 0)
            {
                return;
            }

            // launch status page and pass job, partno and customer as arguments
            this.Hide();
            Form statusPage = new StatusPage(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(),
                                             dataGridView.Rows[e.RowIndex].Cells[4].Value.ToString(),
                                             dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString(),
                                             "Contract Review");

            statusPage.FormClosed += (s, args) => this.Close();
            statusPage.Show();
        }
Exemplo n.º 3
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            // go to status page with job, partNo and customer
            if (partNoLabel.Text.Trim().Length == 0)
            {
                return;
            }
            // calculate the type of form to create after
            if (question3YesRadioButton.Checked || question4YesRadioButton.Checked ||
                question5YesRadioButton.Checked || question6YesRadioButton.Checked ||
                question7YesRadioButton.Checked)
            {
                type = "Contract Review";
            }
            else
            {
                if (question1NewRadioButton.Checked)
                {
                    type = "Quick Release";
                }
                else if (question1ActiveRadioButton.Checked || question1CompleteRadioButton.Checked)
                {
                    type = "Nothing";
                }
            }

            if (this.Modal)
            {
                // TO_DO: Submit query info
                using (OdbcConnection conn = new OdbcConnection(Globals.odbc_connection_string))
                {
                    conn.Open();

                    string query =
                        "INSERT INTO [ATI_Workflow].[dbo].[Honda_PO_Review]\n" +
                        "([Job]\n" +
                        ",[Workflow_ID]\n" +
                        ",[Initiated_By]\n" +
                        ",[Date]\n" +
                        ",[PO_No]\n" +
                        ",[PO_Qty]\n" +
                        ",[PO_Rev]\n" +
                        ",[PO_Rev_Date]\n" +
                        ",[Description_Of_Change]\n" +
                        ",[Question1_Response]\n" +
                        ",[Question2_Response]\n" +
                        ",[Question3_Response]\n" +
                        ",[Question4_Response]\n" +
                        ",[Question5_Response]\n" +
                        ",[Question6_Response]\n" +
                        ",[Question7_Response]\n" +
                        ",[Question8_Response]\n" +
                        ",[Part_Number]\n" +
                        ",[Drawing_Rev]\n" +
                        ",[Applicable_CID_Numbers])\n" +
                        "VALUES\n" +
                        "('" + jobNo + "',\n" +
                        "'" + workflow_id + "',\n" +
                        "'" + Globals.userName + "',\n" +
                        "'" + dateTextBox.Text + "',\n" +
                        "'" + poNoTextBox.Text + "',\n" +
                        "'" + poQtyTextBox.Text + "',\n" +
                        "'" + revTextBox.Text + "',\n" +
                        "'" + revDateTextBox.Text + "',\n" +
                        "'" + descriptionOfChangeTextBox.Text + "',\n" +
                        (question1NewRadioButton.Checked ? "'New'" : (question1ActiveRadioButton.Checked ? "'Active'" : (question1CompleteRadioButton.Checked ? "'Complete'" : "NULL"))) + ",\n" +
                        (question2YesRadioButton.Checked ? "1" : (question2NoRadioButton.Checked ? "0" : "NULL")) + ",\n" +
                        (question3YesRadioButton.Checked ? "'Yes'" : (question3NoRadioButton.Checked ? "'No'" : (question3NARadioButton.Checked ? "'N/A'" : "NULL"))) + ",\n" +
                        (question4YesRadioButton.Checked ? "1" : (question4NoRadioButton.Checked ? "0" : "NULL")) + ",\n" +
                        (question5YesRadioButton.Checked ? "1" : (question5NoRadioButton.Checked ? "0" : "NULL")) + ",\n" +
                        (question6YesRadioButton.Checked ? "1" : (question6NoRadioButton.Checked ? "0" : "NULL")) + ",\n" +
                        (question7YesRadioButton.Checked ? "'Yes'" : (question7NoRadioButton.Checked ? "'No'" : (question7NARadioButton.Checked ? "'N/A'" : "NULL"))) + ",\n" +
                        (question8YesRadioButton.Checked ? "1" : (question8NoRadioButton.Checked ? "0" : "NULL")) + ",\n" +
                        "'" + partNoLabel.Text + "',\n" +
                        "'" + drawingRevTextBox.TextAlign + "',\n" +
                        "'" + applicableCIDNosTextBox.Text + "');";

                    OdbcCommand com  = new OdbcCommand(query, conn);
                    int         rows = com.ExecuteNonQuery();
                }

                this.Close();
            }
            else
            {
                // load status page
                this.Hide();
                Form statusForm = new StatusPage(jobNo, partNoLabel.Text.Trim(), "HONDA AERO", type);
                statusForm.FormClosed += (s, args) => this.Close();
                statusForm.Show();
            }
        }