コード例 #1
0
        private void step4_DoubleClick(object sender, EventArgs e)
        {
            bool updated = false;

            if (type == Status_Type.ContractReview)
            {
                ContractReviewCheckList_QA contractReviewQA = new ContractReviewCheckList_QA(jobNo, int.Parse(workflowListBox.SelectedItem.ToString()));
                contractReviewQA.ShowDialog();
                updated = contractReviewQA.been_updated;
            }
            else if (type == Status_Type.QuickRelease)
            {
                QuickReleaseForm_Quality quickReleaseForm = new QuickReleaseForm_Quality(jobNo, partNo, int.Parse(workflowListBox.SelectedItem.ToString()));
                quickReleaseForm.ShowDialog();
                updated = quickReleaseForm.been_updated;
            }

            if (updated)
            {
                using (OdbcConnection conn = new OdbcConnection(Globals.odbc_connection_string))
                {
                    conn.Open();

                    // update query
                    string query = string.Empty;

                    if (type == Status_Type.ContractReview)
                    {
                        query =
                            "UPDATE [ATI_Workflow].[dbo].[StatusData]\n" +
                            "SET[LastUpdated] = '" + DateTime.Now.ToString() + "'\n" +
                            ",[ContractReview_QA_Status] = 'Complete'\n" +
                            ",[ContractReview_QA_UserName] = '" + Globals.userName + "'\n" +
                            ",[ContractReview_QA_TimeStamp] = '" + DateTime.Now.ToString() + "'\n" +
                            "WHERE Job = '" + jobNo + "' AND Workflow_ID = '" + int.Parse(workflowListBox.SelectedItem.ToString()) + "';";
                    }
                    else
                    {
                        query =
                            "UPDATE [ATI_Workflow].[dbo].[StatusData]\n" +
                            "SET[LastUpdated] = '" + DateTime.Now.ToString() + "'\n" +
                            ",[QuickRelease_Quality_Status] = 'Complete'\n" +
                            ",[QuickRelease_Quality_UserName] = '" + Globals.userName + "'\n" +
                            ",[QuickRelease_Quality_TimeStamp] = '" + DateTime.Now.ToString() + "'\n" +
                            "WHERE Job = '" + jobNo + "' AND Workflow_ID = '" + int.Parse(workflowListBox.SelectedItem.ToString()) + "';";
                    }

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

                    if (rows != 1)
                    {
                        MessageBox.Show(Globals.generic_IT_error);
                    }
                }
                UpdateFromDB(int.Parse(workflowListBox.SelectedItem.ToString()));
            }
        }
コード例 #2
0
        private void contractReviewQAButton_Click(object sender, EventArgs e)
        {
            Form contractReviewQAForm = new ContractReviewCheckList_QA("10", 101);

            contractReviewQAForm.Show();
        }