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);
        }
Example #2
0
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            if (this.myDataTable == null)
            {
                this.DialogResult          = DialogResult.None;
                this.label_ErrMessage.Text = "没有添加焊工!";
                return;
            }
            string str_ErrMessage;
            Class_KindofEmployerStudent myClass_KindofEmployerStudent;

            foreach (DataRow myDataRow in this.myDataTable.Rows)
            {
                myDataRow["WelderRemark"]     = "";
                myClass_KindofEmployerStudent = new Class_KindofEmployerStudent();
                myClass_KindofEmployerStudent.KindofEmployerIssueID  = this.int_KindofEmployerIssueID;
                myClass_KindofEmployerStudent.KindofEmployerWelderID = (int)myDataRow["KindofEmployerWelderID"];
                myClass_KindofEmployerStudent.ExamSubjectID          = this.TextBox_SubjectID.Text;
                if (Class_KindofEmployerStudent.ExistSecond(myClass_KindofEmployerStudent.KindofEmployerIssueID, myClass_KindofEmployerStudent.KindofEmployerWelderID, 0, Enum_zwjKindofUpdate.Add))
                {
                    myDataRow["WelderRemark"] = "学员不能重复!";
                }
                else
                {
                    str_ErrMessage = myClass_KindofEmployerStudent.CheckField();
                    if (string.IsNullOrEmpty(str_ErrMessage))
                    {
                        myClass_KindofEmployerStudent.AddAndModify(Enum_zwjKindofUpdate.Add);
                        this.bool_Updated = true;
                    }
                    else
                    {
                        myDataRow["WelderRemark"] = str_ErrMessage;
                    }
                }
            }
            DataRow[] myDataRowRange = this.myDataTable.Select("WelderRemark = '' or WelderRemark is null");
            if (myDataRowRange.Length < this.myDataTable.Rows.Count)
            {
                this.label_ErrMessage.Text = "有数据不合法!请查看备注信息";
                this.DialogResult          = DialogResult.None;
            }
            foreach (DataRow myDataRow in myDataRowRange)
            {
                myDataRow.Delete();
            }
            this.myDataTable.AcceptChanges();
        }