Beispiel #1
0
        private void OnSqlExec()
        {
            try
            {
                string strSql = this.richTextBox1.Text;
                if (string.IsNullOrEmpty(strSql))
                {
                    return;
                }

                if (this.toolStripComboBox1.Text == "线体控制数据库")
                {
                    DataSet ds = DbHelperSQL.Query(strSql);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        this.dataGridView1.DataSource = ds.Tables[0];
                    }
                }
                else if (this.toolStripComboBox1.Text == "MES数据库")
                {
                    this.dataGridView1.DataSource = mesDA.ReadMesTable(strSql);
                }
                else
                {
                    MessageBox.Show("错误的选择");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #2
0
        private void OnSqlExec()
        {
            try
            {
                string strSql = this.richTextBoxSql.Text;
                if (string.IsNullOrEmpty(strSql))
                {
                    return;
                }

                this.dataGridViewMESDt.DataSource = mesDA.ReadMesTable(strSql);
                if (this.dataGridViewMESDt.Columns.Contains("TRX_TIME"))
                {
                    this.dataGridViewMESDt.Columns["TRX_TIME"].DefaultCellStyle.Format      = "yyyy-MM-dd HH:mm:ss";
                    this.dataGridViewMESDt.Columns["CREATION_TIME"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #3
0
        private void OnMesData()
        {
            if (string.IsNullOrWhiteSpace(this.textBoxBarcode2.Text))
            {
                return;
            }
            string    strSql = string.Format("select * from FT_MES_STEP_INFO where SERIAL_NUMBER='{0}' order by TRX_TIME desc", this.textBoxBarcode2.Text);
            DataTable dt     = mesDA.ReadMesTable(strSql);

            this.dataGridView2.DataSource = dt;

            this.dataGridView1.Columns["SERIAL_NUMBER"].HeaderText                 = "主机条码";
            this.dataGridView1.Columns["STEP_NUMBER"].HeaderText                   = "工位号";
            this.dataGridView1.Columns["STATUS"].HeaderText                        = "状态";
            this.dataGridView1.Columns["TRX_TIME"].HeaderText                      = "数据上传时间";
            this.dataGridView1.Columns["TRX_TIME"].DefaultCellStyle.Format         = "yyyy-MM-dd HH:mm:ss";
            this.dataGridView1.Columns["LAST_MODIFY_TIME"].HeaderText              = "最后一次修改时间";
            this.dataGridView1.Columns["LAST_MODIFY_TIME"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";



            this.dataGridView1.Columns["CHECK_RESULT"].HeaderText = "检测结果";
            this.dataGridView1.Columns["STEP_MARK"].HeaderText    = "工位标识(检测/下线)";
            this.dataGridView1.Columns["DEFECT_CODES"].HeaderText = "不合格项代码";
            this.dataGridView1.Columns["REASON"].HeaderText       = "原因说明";

            this.dataGridView1.Columns["USER_NAME"].Visible = false;
            this.dataGridView1.Columns["RECID"].Visible     = false;

            this.dataGridView1.Columns["STATUS"].Width           = 50;
            this.dataGridView1.Columns["SERIAL_NUMBER"].Width    = 150;
            this.dataGridView1.Columns["TRX_TIME"].Width         = 150;
            this.dataGridView1.Columns["LAST_MODIFY_TIME"].Width = 150;
            this.dataGridView1.Columns["REASON"].AutoSizeMode    = DataGridViewAutoSizeColumnMode.Fill;
            this.dataGridView1.Columns["CHECK_RESULT"].Width     = 50;
            this.dataGridView1.Columns["STEP_MARK"].Width        = 50;
            this.dataGridView1.Columns["CHECK_RESULT"].Width     = 50;
        }