private void dataGridView_Data_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            EventArgs_KindofEmployerIssue myEventArgs_KindofEmployerIssue = new EventArgs_KindofEmployerIssue();

            myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID = (int)this.dataGridView_Data.Rows[e.RowIndex].Cells["KindofEmployerIssueID"].Value;
            Publisher_KindofEmployerIssue.OnEventName(myEventArgs_KindofEmployerIssue);
        }
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            this.userControl_KindofEmployerStudent_Base1.FillClass();
            String str_ErrMessage;

            str_ErrMessage = this.myClass_KindofEmployerStudent.CheckField();
            if (!string.IsNullOrEmpty(str_ErrMessage))
            {
                this.DialogResult          = DialogResult.None;
                this.label_ErrMessage.Text = str_ErrMessage;
                return;
            }
            if (this.bool_Add)
            {
                if (Class_KindofEmployerStudent.ExistSecond(this.myClass_KindofEmployerStudent.KindofEmployerIssueID, this.myClass_KindofEmployerStudent.KindofEmployerWelderID, 0, Enum_zwjKindofUpdate.Add))
                {
                    this.DialogResult          = DialogResult.None;
                    this.label_ErrMessage.Text = "焊工编号不能重复!";
                    return;
                }
                else
                {
                    this.myClass_KindofEmployerStudent.AddAndModify(Enum_zwjKindofUpdate.Add);

                    if (this.checkBox_Continuous.Checked)
                    {
                        EventArgs_KindofEmployerIssue my_e = new EventArgs_KindofEmployerIssue(this.myClass_KindofEmployerStudent.KindofEmployerIssueID);
                        Publisher_KindofEmployerIssue.OnEventName(my_e);
                        this.label_ErrMessage.Text = "";
                        this.DialogResult          = DialogResult.None;
                        return;
                    }
                    else
                    {
                        this.DialogResult = DialogResult.OK;
                        return;
                    }
                }
            }
            else
            {
                if (Class_KindofEmployerStudent.ExistSecond(this.myClass_KindofEmployerStudent.KindofEmployerIssueID, this.myClass_KindofEmployerStudent.KindofEmployerWelderID, this.myClass_KindofEmployerStudent.KindofEmployerStudentID, Enum_zwjKindofUpdate.Modify))
                {
                    this.DialogResult          = DialogResult.None;
                    this.label_ErrMessage.Text = "焊工编号不能重复!";
                    return;
                }
                else
                {
                    this.myClass_KindofEmployerStudent.AddAndModify(Enum_zwjKindofUpdate.Modify);
                }
            }
        }
        private void toolStripMenuItem_RowTransferIssue_Click(object sender, EventArgs e)
        {
            bool bool_Transfer   = false;
            int  int_CheckSignUp = Class_KindofEmployerIssue.CheckSignUp((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value, false);

            if (Properties.Settings.Default.WebServiceStartUp)
            {
                DataView myDataView_Temp = new DataView(Class_KindofEmployerIssue.GetDataTable_KindofEmployerWelderStudent((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value, "StudentRemark is Null or StudentRemark=''", null));
                foreach (DataRowView myDataRowView in myDataView_Temp)
                {
                    if (!Class_Welder.ExistWelderPicture(myDataRowView["IdentificationCard"].ToString()))
                    {
                        int_CheckSignUp++;
                        Class_KindofEmployerStudent myClass_KindofEmployerStudent = new Class_KindofEmployerStudent((int)myDataRowView["KindofEmployerStudentID"]);
                        myClass_KindofEmployerStudent.StudentRemark = "该焊工没有电子照片";
                        myClass_KindofEmployerStudent.AddAndModify(Enum_zwjKindofUpdate.Modify);
                    }
                }
            }

            if (int_CheckSignUp > 0)
            {
                if (MessageBox.Show(string.Format("该班级有 {0} 名学员不符合报考资格,详细信息请查阅学员的备注字段。确认把只具有报考资格的学员编入班级吗?", int_CheckSignUp), "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    bool_Transfer = true;
                }
            }
            else
            {
                if (MessageBox.Show("确认编入班级吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    bool_Transfer = true;
                }
            }
            if (bool_Transfer)
            {
                string str_IssueNo = Class_KindofEmployerIssue.TransferIssue((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value);
                if (string.IsNullOrEmpty(str_IssueNo))
                {
                    MessageBox.Show("编入新班级失败,可能是下一个班级编号或考试编号设置错误!");
                }
                else
                {
                    MessageBox.Show(string.Format("新班级编号为 {0} ,请进入考试管理界面查询详细信息!", str_IssueNo));
                }
            }
            EventArgs_KindofEmployerIssue myEventArgs_KindofEmployerIssue = new EventArgs_KindofEmployerIssue();

            myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID = (int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value;
            Publisher_KindofEmployerIssue.OnEventName(myEventArgs_KindofEmployerIssue);
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitDataGridView(object sender, EventArgs_KindofEmployer e)
        {
            this.myEventArgs_KindofEmployer = e;
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.KindofEmployerIssue.ToString(), false);
            Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.KindofEmployerIssue.ToString()];

            myClass_Data.SetFilter(string.Format("KindofEmployer='{0}'", this.myEventArgs_KindofEmployer.str_KindofEmployer));
            if (this.myEventArgs_KindofEmployer.bool_JustFill)
            {
                if (this.myDataTable.Rows.Count == 0)
                {
                    this.dataGridView_Data.DataSource = null;
                    myClass_Data.RefreshData(this.myEventArgs_KindofEmployer.bool_JustFill);
                    this.myDataTable = myClass_Data.myDataTable.Copy();
                    this.myDataView  = new DataView(this.myDataTable);
                    this.dataGridView_Data.DataSource = this.myDataView;
                }
                else
                {
                    myClass_Data.RefreshData(this.myEventArgs_KindofEmployer.bool_JustFill, this.myDataTable);
                }
            }
            else
            {
                this.dataGridView_Data.DataSource = null;
                myClass_Data.RefreshData(this.myEventArgs_KindofEmployer.bool_JustFill);
                this.myDataTable = myClass_Data.myDataTable.Copy();
                this.myDataView  = new DataView(this.myDataTable);
                this.dataGridView_Data.DataSource = this.myDataView;
            }
            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);
            if (this.dataGridView_Data.Rows.Count == 0)
            {
                EventArgs_KindofEmployerIssue myEventArgs_KindofEmployerIssue = new EventArgs_KindofEmployerIssue();
                myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID = 0;
                Publisher_KindofEmployerIssue.OnEventName(myEventArgs_KindofEmployerIssue);
            }
        }
示例#5
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitDataGridView(object sender, EventArgs_KindofEmployerIssue e)
        {
            this.myEventArgs_KindofEmployerIssue = e;
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.KindofEmployerStudent.ToString(), false);
            Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.KindofEmployerStudent.ToString()];

            myClass_Data.SetFilter(string.Format("KindofEmployerIssueID={0}", this.myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID));
            if (this.myEventArgs_KindofEmployerIssue.bool_JustFill)
            {
                if (this.myDataTable.Rows.Count == 0)
                {
                    this.dataGridView_Data.DataSource = null;
                    myClass_Data.RefreshData(this.myEventArgs_KindofEmployerIssue.bool_JustFill);
                    this.myDataTable = myClass_Data.myDataTable.Copy();
                    this.myDataView  = new DataView(this.myDataTable);
                    this.dataGridView_Data.DataSource = this.myDataView;
                }
                else
                {
                    myClass_Data.RefreshData(this.myEventArgs_KindofEmployerIssue.bool_JustFill, this.myDataTable);
                }
            }
            else
            {
                this.dataGridView_Data.DataSource = null;
                myClass_Data.RefreshData(this.myEventArgs_KindofEmployerIssue.bool_JustFill);
                this.myDataTable = myClass_Data.myDataTable.Copy();
                this.myDataView  = new DataView(this.myDataTable);
                this.dataGridView_Data.DataSource = this.myDataView;
            }
            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} 的学员信息,({1}):", this.myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID, this.dataGridView_Data.RowCount);
            if (this.dataGridView_Data.RowCount == 0)
            {
                this.userControl_WelderExamBase1.InitDataGridView(null);
            }
        }