/// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitDataGridView(object sender, EventArgs_WelderFilter e)
        {
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.Welder.ToString(), false);
            SqlCommand myCmd_Temp = new SqlCommand("Person_Welder_Query", Class_zwjPublic.myClass_SqlConnection.mySqlConn);

            myCmd_Temp.CommandType = CommandType.StoredProcedure;
            myCmd_Temp.Parameters.Add("@IdentificationCard", SqlDbType.NChar, 18).Value = ZCCL.Tools.Class_DataValidateTool.CovertIdentificationCard(e.str_IdentificationCard);
            myCmd_Temp.Parameters.Add("@WelderName", SqlDbType.NVarChar, 10).Value      = e.str_WelderName;
            myCmd_Temp.Parameters.Add("@WelderWorkerID", SqlDbType.NVarChar, 10).Value  = e.str_WelderWorkerID;
            myCmd_Temp.Parameters.Add("@RegistrationNo", SqlDbType.NVarChar, 20).Value  = e.str_RegistrationNo;
            myCmd_Temp.Parameters.Add("@ExaminingNo", SqlDbType.NVarChar, 20).Value     = e.str_ExaminingNo;
            myCmd_Temp.Parameters.Add("@CertificateNo", SqlDbType.NVarChar, 20).Value   = e.str_CertificateNo;
            myCmd_Temp.Parameters.Add("@IssueNo", SqlDbType.NVarChar, 20).Value         = e.str_IssueNo;
            if (!string.IsNullOrEmpty(e.str_Filter))
            {
                myCmd_Temp.Parameters.Add("@Filter", SqlDbType.NVarChar).Value = e.str_Filter;
            }
            SqlDataAdapter myAdapter   = new SqlDataAdapter(myCmd_Temp);
            DataTable      myDataTable = new DataTable();

            myAdapter.Fill(myDataTable);
            this.dataGridView_Data.DataSource = new DataView(myDataTable);
            this.label_Data.Text = string.Format("焊工,({0}):", this.dataGridView_Data.RowCount);
            if (this.dataGridView_Data.RowCount == 0)
            {
                EventArgs_Welder my_e = new EventArgs_Welder(null);
                Publisher_Welder.OnEventName(my_e);
                MessageBox.Show("没有找到符合条件的焊工!");
            }
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitDataGridView(object sender, EventArgs_Welder e)
        {
            this.myEventArgs_Welder = e;
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.IssueStudentQCRegistrationNo.ToString(), false);
            Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.ExamAll.ToString()];

            myClass_Data.SetFilter(string.Format("IdentificationCard='{0}'", this.myEventArgs_Welder.str_IdentificationCard));
            this.dataGridView_Data.DataSource = null;
            myClass_Data.RefreshData(false);
            this.dataGridView_Data.DataSource = new DataView(myClass_Data.myDataTable.Copy());
            if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort))
            {
                ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort;
            }
            if (this.checkBox_QC.Checked)
            {
                ((DataView)this.dataGridView_Data.DataSource).RowFilter = string.Format("ValidUntil >= '{0}' And isQCValid=1", DateTime.Today.ToShortDateString());
            }
            else
            {
                ((DataView)this.dataGridView_Data.DataSource).RowFilter = null;
            }
            this.label_Data.Text = string.Format("考试记录,({0}):", this.dataGridView_Data.RowCount);

            this.pictureBox_Welder.Image = Class_Welder.GetWelderPicture(this.myEventArgs_Welder.str_IdentificationCard);

            this.userControl_WelderTestCommitteeRegistrationNoBase1.InitDataGridView(this.myEventArgs_Welder.str_IdentificationCard);

            if (this.dataGridView_Data.RowCount == 0)
            {
                EventArgs_StudentSecond my_e = new EventArgs_StudentSecond(null);
                Publisher_StudentSecond.OnEventName(my_e);
            }
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitDataGridView(object sender, EventArgs_Welder e)
        {
            this.myEventArgs_Welder = e;
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.BlackList.ToString(), false);
            Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.BlackList.ToString()];

            myClass_Data.SetFilter(string.Format("IdentificationCard = '{0}'", this.myEventArgs_Welder.str_IdentificationCard));

            this.dataGridView_Data.DataSource = null;
            myClass_Data.RefreshData(false);
            this.dataGridView_Data.DataSource = new DataView(myClass_Data.myDataTable.Copy());
            if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort))
            {
                ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort;
            }
            this.label_Data.Text = string.Format("黑名单记录,({0}):", this.dataGridView_Data.RowCount);
        }
        private void dataGridView_Data_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            EventArgs_Welder my_e = new EventArgs_Welder(this.dataGridView_Data.Rows[e.RowIndex].Cells["IdentificationCard"].Value.ToString());

            Publisher_Welder.OnEventName(my_e);
        }
Exemplo n.º 5
0
 private void InitstatusStrip(object sender, EventArgs_Welder e)
 {
     this.toolStripStatusLabel_IdentificationCard.Text = string.Format("Éí·ÝÖ¤ºÅÂ룺{0}", e.str_IdentificationCard);
 }