Пример #1
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="myClass_KindofEmployerStudent"></param>
        /// <param name="bool_Add"></param>
        public void InitControl(Class_KindofEmployerStudent myClass_KindofEmployerStudent, bool bool_Add)
        {
            Class_Public.InitializeComboBox(this.ComboBox_KindofExam, Enum_DataTable.KindofExam.ToString(), "KindofExam", "KindofExam");
            Class_KindofEmployerIssue myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(myClass_KindofEmployerStudent.KindofEmployerIssueID);

            this.TextBox_IssueNo.Text               = myClass_KindofEmployerIssue.IssueNo;
            this.textBox_WeldingProcessAb.Text      = myClass_KindofEmployerIssue.WeldingProcessAb;
            this.textBox_KindofEmployerIssueID.Text = myClass_KindofEmployerIssue.KindofEmployerIssueID.ToString();
            this.myClass_KindofEmployerStudent      = myClass_KindofEmployerStudent;
            if (bool_Add)
            {
                if (myClass_KindofEmployerStudentDefault != null)
                {
                    this.ComboBox_KindofExam.SelectedValue = myClass_KindofEmployerStudentDefault.StudentKindofExam;
                    this.InitControlWeldingSubject(new Class_WeldingSubject(myClass_KindofEmployerStudentDefault.ExamSubjectID));
                }
                else
                {
                    this.ComboBox_KindofExam.SelectedValue = myClass_KindofEmployerIssue.myClass_WeldingParameter.KindofExam;
                }
            }
            else
            {
                this.ComboBox_KindofExam.SelectedValue    = this.myClass_KindofEmployerStudent.StudentKindofExam;
                this.TextBox_StudentRemark.Text           = myClass_KindofEmployerStudent.StudentRemark;
                this.textBox_KindofEmployerStudentID.Text = this.myClass_KindofEmployerStudent.KindofEmployerStudentID.ToString();

                this.InitControlWelder(new Class_KindofEmployerWelder(this.myClass_KindofEmployerStudent.KindofEmployerWelderID));
                this.InitControlWeldingSubject(new Class_WeldingSubject(this.myClass_KindofEmployerStudent.ExamSubjectID));
            }
        }
        /// <summary>
        /// 更新数据到对象中
        /// </summary>
        public void FillClass()
        {
            this.FillWeldingParameterClass(this.myClass_KindofEmployerIssue.myClass_WeldingParameter);
            myClass_KindofEmployerIssue.IssueNo     = this.MaskedTextBox_IssueNo.Text;
            myClass_KindofEmployerIssue.IssueRemark = this.TextBox_IssueRemark.Text;
            this.myClass_KindofEmployerIssue.ShipClassificationAb = this.comboBox_ShipClassificationAb.SelectedValue.ToString();
            if (this.comboBox_ShipboardNo.SelectedValue != null)
            {
                this.myClass_KindofEmployerIssue.ShipboardNo = this.comboBox_ShipboardNo.SelectedValue.ToString();
            }
            else
            {
                this.myClass_KindofEmployerIssue.ShipboardNo = "";
            }
            myClass_KindofEmployerIssue.WeldingProcessAb = this.ComboBox_WeldingProcess.SelectedValue.ToString();
            myClass_KindofEmployerIssue.EmployerHPID     = this.comboBox_Employer.SelectedValue.ToString();

            myClass_KindofEmployerIssue.SignUpDate = this.DateTimePicker_SignUpDate.Value;

            if (myClass_KindofEmployerIssueDefault == null)
            {
                myClass_KindofEmployerIssueDefault = new Class_KindofEmployerIssue();
            }
            this.FillWeldingParameterClass(myClass_KindofEmployerIssueDefault.myClass_WeldingParameter);
            myClass_KindofEmployerIssueDefault.WeldingProcessAb     = myClass_KindofEmployerIssue.WeldingProcessAb;
            myClass_KindofEmployerIssueDefault.EmployerHPID         = myClass_KindofEmployerIssue.EmployerHPID;
            myClass_KindofEmployerIssueDefault.ShipClassificationAb = myClass_KindofEmployerIssue.ShipClassificationAb;
            myClass_KindofEmployerIssueDefault.ShipboardNo          = myClass_KindofEmployerIssue.ShipboardNo;
        }
Пример #3
0
        private void button_WelderAdd_Click(object sender, EventArgs e)
        {
            Form_KindofEmployerWelder_Query myForm = new Form_KindofEmployerWelder_Query();
            Class_KindofEmployerIssue       myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(this.int_KindofEmployerIssueID);

            myForm.str_KindofEmployer = myClass_KindofEmployerIssue.KindofEmployer;
            myForm.bool_QueryBatch    = true;
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                if (this.myDataTable == null)
                {
                    this.myDataTable = myForm.myDataTable;
                    this.dataGridView_Data.DataSource = new DataView(this.myDataTable);
                }
                else
                {
                    foreach (DataRow myDataRow in myForm.myDataTable.Rows)
                    {
                        if (this.myDataTable.Select(string.Format("KindofEmployerWelderID={0}", myDataRow["KindofEmployerWelderID"])).Length == 0)
                        {
                            this.myDataTable.ImportRow(myDataRow);
                        }
                    }
                }
                this.label_Data.Text = string.Format("学员,({0}):", this.myDataTable.Rows.Count);
            }
        }
Пример #4
0
        private void Form_KindofEmployerStudent_AddBatch_Load(object sender, EventArgs e)
        {
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.KindofEmployerWelder.ToString(), false);
            Class_KindofEmployerIssue myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(this.int_KindofEmployerIssueID);

            this.TextBox_IssueNo.Text = myClass_KindofEmployerIssue.IssueNo;
            this.MaskedTextBox_KindofEmployerIssueID.Text = myClass_KindofEmployerIssue.KindofEmployerIssueID.ToString();
        }
        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 toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e)
 {
     if (Class_KindofEmployerIssue.ExistAndCanDeleteAndDelete((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value, Enum_zwjKindofUpdate.CanDelete))
     {
         if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             Class_KindofEmployerIssue.ExistAndCanDeleteAndDelete((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerIssueID"].Value, Enum_zwjKindofUpdate.Delete);
             this.RefreshData(false);
         }
     }
     else
     {
         MessageBox.Show("不能删除!");
     }
 }
Пример #7
0
        private void Button_SubjectQuery_Click(object sender, EventArgs e)
        {
            Class_KindofEmployerIssue myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(this.int_KindofEmployerIssueID);
            Class_ShipClassification  myClass_ShipClassification  = new Class_ShipClassification(myClass_KindofEmployerIssue.ShipClassificationAb);
            Form_WeldingSubject_Query myForm = new Form_WeldingSubject_Query();

            if (myClass_ShipClassification.WeldingStandardRestrict)
            {
                myForm.str_FilterRestrict = string.Format("WeldingStandard='{0}'", myClass_ShipClassification.WeldingStandard);;
            }
            myForm.myClass_WeldingSubject = new Class_WeldingSubject();
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.InitControlWeldingSubject(myForm.myClass_WeldingSubject);
            }
        }
Пример #8
0
 private void Form_KindofEmployerIssue_Update_Load(object sender, EventArgs e)
 {
     if (!(this.bool_Add || Class_KindofEmployerIssue.ExistAndCanDeleteAndDelete(myClass_KindofEmployerIssue.KindofEmployerIssueID, Enum_zwjKindofUpdate.Exist)))
     {
         MessageBox.Show("不存在该项,可能已删除!");
         this.DialogResult = DialogResult.Cancel;
         this.Close();
         return;
     }
     this.label_ErrMessage.Text = "";
     if (!Class_zwjPublic.myBackColor.IsEmpty)
     {
         this.BackColor = Class_zwjPublic.myBackColor;
     }
     this.userControl_KindofEmployerIssue_Base1.InitControl(this.myClass_KindofEmployerIssue, this.bool_Add);
 }
Пример #9
0
        private void Button_WelderUpdate_Click(object sender, EventArgs e)
        {
            Form_KindofEmployerWelder_Query myForm = new Form_KindofEmployerWelder_Query();
            Class_KindofEmployerIssue       myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(myClass_KindofEmployerStudent.KindofEmployerIssueID);

            myForm.str_KindofEmployer           = myClass_KindofEmployerIssue.KindofEmployer;
            myForm.myClass_KindofEmployerWelder = new Class_KindofEmployerWelder();
            myForm.myClass_KindofEmployerWelder.KindofEmployer = myClass_KindofEmployerIssue.KindofEmployer;
            if (this.myClass_KindofEmployerStudent.KindofEmployerWelderID > 0)
            {
                myForm.myClass_KindofEmployerWelder.KindofEmployerWelderID = this.myClass_KindofEmployerStudent.KindofEmployerWelderID;
                myForm.myClass_KindofEmployerWelder.FillData();
            }
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.myClass_KindofEmployerStudent.KindofEmployerWelderID = myForm.myClass_KindofEmployerWelder.KindofEmployerWelderID;
                this.InitControlWelder(myForm.myClass_KindofEmployerWelder);
            }
        }
Пример #10
0
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            this.userControl_KindofEmployerIssue_Base1.FillClass();
            String str_ErrMessage;

            str_ErrMessage = this.myClass_KindofEmployerIssue.CheckField();
            if (!string.IsNullOrEmpty(str_ErrMessage))
            {
                this.DialogResult          = DialogResult.None;
                this.label_ErrMessage.Text = str_ErrMessage;
                return;
            }
            if (this.bool_Add)
            {
                if (Class_KindofEmployerIssue.ExistSecond(this.myClass_KindofEmployerIssue.KindofEmployer, this.myClass_KindofEmployerIssue.IssueNo, 0, Enum_zwjKindofUpdate.Add))
                {
                    this.DialogResult          = DialogResult.None;
                    this.label_ErrMessage.Text = "班级名称不能重复!";
                    return;
                }
                else
                {
                    this.myClass_KindofEmployerIssue.AddAndModify(Enum_zwjKindofUpdate.Add);
                }
            }
            else
            {
                if (Class_KindofEmployerIssue.ExistSecond(this.myClass_KindofEmployerIssue.KindofEmployer, this.myClass_KindofEmployerIssue.IssueNo, this.myClass_KindofEmployerIssue.KindofEmployerIssueID, Enum_zwjKindofUpdate.Modify))
                {
                    this.DialogResult          = DialogResult.None;
                    this.label_ErrMessage.Text = "班级名称不能重复!";
                    return;
                }
                else
                {
                    this.myClass_KindofEmployerIssue.AddAndModify(Enum_zwjKindofUpdate.Modify);
                }
            }
        }
        public void InitControl(Class_KindofEmployerIssue myClass_KindofEmployerIssue, bool bool_Add)
        {
            Class_Data myClass_ShipandShipClassification = (Class_Data)Class_Public.myHashtable[Enum_DataTable.ShipandShipClassification.ToString()];

            myDataView_ShipandShipClassification      = new DataView(myClass_ShipandShipClassification.myDataTable);
            myDataView_ShipandShipClassification.Sort = myClass_ShipandShipClassification.myDataView.Sort;
            Class_DataControlBind.InitializeComboBox(this.comboBox_ShipboardNo, this.myDataView_ShipandShipClassification, "ShipboardNo", "ShipboardNo");

            Class_Public.InitializeComboBox(this.comboBox_Employer, Enum_DataTable.Employer.ToString(), "EmployerHPID", "Employer");
            Class_Public.InitializeComboBox(this.comboBox_ShipClassificationAb, Enum_DataTable.ShipClassification.ToString(), "ShipClassificationAb", "ShipClassificationAb");
            Class_Public.InitializeComboBox(this.ComboBox_Assemblage, Enum_DataTable.Assemblage.ToString(), "Assemblage", "Assemblage");
            Class_Public.InitializeComboBox(this.ComboBox_KindofExam, Enum_DataTable.KindofExam.ToString(), "KindofExam", "KindofExam");
            Class_Public.InitializeComboBox(this.ComboBox_WeldingProcess, Enum_DataTable.WeldingProcess.ToString(), "WeldingProcessAb", "WeldingProcessAb");
            this.myClass_KindofEmployerIssue = myClass_KindofEmployerIssue;
            this.textBox_KindofEmployer.Text = this.myClass_KindofEmployerIssue.KindofEmployer;

            Class_KindofEmployer myClass_KindofEmployer = new Class_KindofEmployer(this.myClass_KindofEmployerIssue.KindofEmployer);

            switch (myClass_KindofEmployer.KindofEmployerLevel)
            {
            case 0:
                break;

            case 1:
            case 2:
            case 3:
            case 4:
                this.comboBox_Employer.Enabled = false;
                break;
            }
            if (bool_Add)
            {
                if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerEmployerHPID))
                {
                    this.comboBox_Employer.SelectedValue = myClass_KindofEmployer.KindofEmployerEmployerHPID;
                }
                if (myClass_KindofEmployerIssueDefault != null)
                {
                    this.InitControlWeldingParameter(myClass_KindofEmployerIssueDefault.myClass_WeldingParameter);
                    this.ComboBox_WeldingProcess.SelectedValue = myClass_KindofEmployerIssueDefault.WeldingProcessAb;
                    if (this.comboBox_Employer.Enabled)
                    {
                        this.comboBox_Employer.SelectedValue = myClass_KindofEmployerIssueDefault.EmployerHPID;
                    }
                    this.myClass_KindofEmployerIssue.EmployerHPID    = myClass_KindofEmployerIssueDefault.EmployerHPID;
                    this.comboBox_ShipClassificationAb.SelectedValue = myClass_KindofEmployerIssueDefault.ShipClassificationAb;
                    this.comboBox_ShipboardNo.SelectedValue          = myClass_KindofEmployerIssueDefault.ShipboardNo;
                }
            }
            else
            {
                this.textBox_KindofEmployerIssueID.Text = this.myClass_KindofEmployerIssue.KindofEmployerIssueID.ToString();
                this.MaskedTextBox_IssueNo.Text         = myClass_KindofEmployerIssue.IssueNo;
                this.textBox_WPSNo.Text                          = myClass_KindofEmployerIssue.IssueWPSNo;
                this.TextBox_IssueRemark.Text                    = myClass_KindofEmployerIssue.IssueRemark;
                this.DateTimePicker_SignUpDate.Value             = myClass_KindofEmployerIssue.SignUpDate;
                this.textBox_KindofEmployer.Text                 = myClass_KindofEmployerIssue.KindofEmployer;
                this.comboBox_Employer.SelectedValue             = myClass_KindofEmployerIssue.EmployerHPID;
                this.ComboBox_WeldingProcess.SelectedValue       = myClass_KindofEmployerIssue.WeldingProcessAb;
                this.comboBox_ShipClassificationAb.SelectedValue = this.myClass_KindofEmployerIssue.ShipClassificationAb;
                this.comboBox_ShipboardNo.SelectedValue          = this.myClass_KindofEmployerIssue.ShipboardNo;

                this.InitControlWeldingParameter(this.myClass_KindofEmployerIssue.myClass_WeldingParameter);
            }
        }
Пример #12
0
        private void toolStripMenuItem_RowTransferToIssue_Click(object sender, EventArgs e)
        {
            //Form_InputBox myForm = new Form_InputBox();
            //myForm.str_DefaultResponse = this.str_IssueNo;
            //myForm.str_Prompt = "请输入班级编号:";
            //myForm.str_Title = "输入班级编号";
            //if (myForm.ShowDialog() == DialogResult.OK)
            //{
            //    this.str_IssueNo = myForm.str_DefaultResponse;
            //}
            //else
            //{
            //    return;
            //}
            Form_Issue_Query myForm = new Form_Issue_Query();

            myForm.myClass_Issue = new Class_Issue();
            if (!string.IsNullOrEmpty(this.str_IssueNo))
            {
                myForm.myClass_Issue.IssueNo = this.str_IssueNo;
                myForm.myClass_Issue.FillData();
            }
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.str_IssueNo = myForm.myClass_Issue.IssueNo;
            }
            else
            {
                return;
            }

            if (Class_Issue.ExistAndCanDeleteAndDelete(this.str_IssueNo, Enum_zwjKindofUpdate.Exist))
            {
                Class_KindofEmployerStudent myClass_KindofEmployerStudent = new Class_KindofEmployerStudent((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerStudentID"].Value);
                Class_KindofEmployerWelder  myClass_KindofEmployerWelder  = new Class_KindofEmployerWelder(myClass_KindofEmployerStudent.KindofEmployerWelderID);
                Class_Student myClass_Student = new Class_Student();
                myClass_Student.IssueNo            = this.str_IssueNo;
                myClass_Student.IdentificationCard = myClass_KindofEmployerWelder.IdentificationCard;
                myClass_Student.SubjectID          = myClass_KindofEmployerStudent.ExamSubjectID;
                Class_Issue myClass_Issue = new Class_Issue(myClass_Student.IssueNo);
                myClass_Student.myClass_WeldingParameter            = myClass_Issue.myClass_WeldingParameter;
                myClass_Student.myClass_WeldingParameter.KindofExam = myClass_KindofEmployerStudent.StudentKindofExam;
                Class_KindofEmployerIssue myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(myClass_KindofEmployerStudent.KindofEmployerIssueID);
                myClass_Student.WPSNo = myClass_KindofEmployerIssue.IssueWPSNo;
                string str_ReturnMessage;
                str_ReturnMessage = myClass_Student.CheckField();
                if (string.IsNullOrEmpty(str_ReturnMessage))
                {
                    Class_KindofEmployerWelder.TransferWelder(myClass_KindofEmployerStudent.KindofEmployerWelderID);
                    myClass_Student.AddAndModify(Enum_zwjKindofUpdate.Add);
                    if (string.IsNullOrEmpty(myClass_Student.ExaminingNo))
                    {
                        MessageBox.Show("编入班级失败,可能是下一个考编号设置错误!");
                    }
                    else
                    {
                        Class_KindofEmployerStudent.ExistAndCanDeleteAndDelete(myClass_KindofEmployerStudent.KindofEmployerStudentID, Enum_zwjKindofUpdate.Delete);
                        this.myEventArgs_KindofEmployerIssue.bool_JustFill = false;
                        Publisher_KindofEmployerIssue.OnEventName(this.myEventArgs_KindofEmployerIssue);
                        MessageBox.Show(string.Format("编入班级成功,班级编号为 {0},考编号为 {1}", this.str_IssueNo, myClass_Student.ExaminingNo));
                    }
                }
                else
                {
                    MessageBox.Show(string.Format("编入班级失败,{0}!", str_ReturnMessage));
                }
            }
            else
            {
                MessageBox.Show(string.Format("不存在班级编号为 {0} 的班级!", this.str_IssueNo));
            }
        }