Example #1
0
        private void Button_IdentificationCardModify_Click(object sender, EventArgs e)
        {
            this.userControl_WelderBase1.FillClass();
            string        str_NewIdentificationCard = "";
            Form_InputBox myForm = new Form_InputBox();

            myForm.str_DefaultResponse = this.myClass_Welder.IdentificationCard;
            myForm.str_Prompt          = "请输入身份证号码:";
            myForm.str_Title           = "输入身份证号码";
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                str_NewIdentificationCard = myForm.str_DefaultResponse;
            }
            else
            {
                return;
            }
            if (!Class_DataValidateTool.CheckIdentificationCard(str_NewIdentificationCard, this.myClass_Welder.Sex))
            {
                MessageBox.Show("身份证号码格式错误,操作失败!");
                return;
            }
            if (Class_Welder.ExistAndCanDeleteAndDelete(str_NewIdentificationCard, ZCCL.ClassBase.Enum_zwjKindofUpdate.Exist) == true)
            {
                MessageBox.Show("身份证号码重复,操作失败!");
                return;
            }
            this.myClass_Welder.IdentificationCardModify(str_NewIdentificationCard, this.myClass_Welder.Sex);
            this.userControl_WelderBase1.InitControl(this.myClass_Welder, false);
        }
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            EventArgs_WelderFilter my_e = new EventArgs_WelderFilter(null);

            my_e.str_IdentificationCard = Class_DataValidateTool.CovertIdentificationCard(this.TextBox_IdentificationCardQuery.Text);
            my_e.str_WelderName         = this.TextBox_WelderNameQuery.Text;
            my_e.str_RegistrationNo     = this.TextBox_RegistrationNoQuery.Text;
            my_e.str_WelderWorkerID     = this.TextBox_WorkerIDQuery.Text;
            my_e.str_ExaminingNo        = this.TextBox_ExaminingNoQuery.Text;
            my_e.str_CertificateNo      = this.TextBox_CertificateNoQuery.Text;
            my_e.str_IssueNo            = this.textBox_IssueNoQuery.Text;
            Publisher_WelderFilter.OnEventName(my_e);
        }
        private void toolStripMenuItem_RowAddByExcel_Click(object sender, EventArgs e)
        {
            DataTable myDataTable = Class_DataControlBind.ImportExcelToDataTable();

            if (myDataTable != null)
            {
                if (!myDataTable.Columns.Contains("IdentificationCard"))
                {
                    MessageBox.Show("数据表中不存在 'IdentificationCard' 列!");
                    return;
                }
                DataRow[] myDataRow_Range;
                myDataRow_Range = myDataTable.Select("len(IdentificationCard)>0");
                StringBuilder myStringBuilder = new StringBuilder();
                myStringBuilder.Append("1=0");
                foreach (DataRow myDataRow in myDataRow_Range)
                {
                    myStringBuilder.Append(string.Format(" Or IdentificationCard='{0}'", Class_DataValidateTool.CovertIdentificationCard(myDataRow["IdentificationCard"].ToString())));
                }
                EventArgs_WelderFilter g = new EventArgs_WelderFilter(myStringBuilder.ToString());
                Publisher_WelderFilter.OnEventName(g);
            }
        }
Example #4
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="myClass_Issue"></param>
        /// <param name="bool_Add"></param>
        public void InitControl(Class_Issue myClass_Issue, bool bool_Add)
        {
            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_Issue = myClass_Issue;
            this.textBox_ShipClassificationAb.Text = this.myClass_Issue.ShipClassificationAb;
            this.TextBox_ShipboardNo.Text          = this.myClass_Issue.ShipboardNo;
            if (bool_Add)
            {
                Class_ShipClassification myClass_ShipClassification = new Class_ShipClassification(this.myClass_Issue.ShipClassificationAb);
                if (myClass_ShipClassification.ShipRestrict)
                {
                    Class_Ship myClass_Ship = new Class_Ship(this.myClass_Issue.ShipboardNo);
                    this.MaskedTextBox_IssueNo.Text = myClass_Ship.NextSkillIssueNo;
                }
                else
                {
                    this.MaskedTextBox_IssueNo.Text = myClass_ShipClassification.NextIssueNo;
                }
                if (myClass_IssueDefault != null)
                {
                    this.InitControlWeldingParameter(myClass_IssueDefault.myClass_WeldingParameter);
                    this.ComboBox_WeldingProcess.SelectedValue = myClass_IssueDefault.WeldingProcessAb;
                    this.TextBox_PlaceofTest.Text           = myClass_IssueDefault.PlaceofTest;
                    this.TextBox_SupervisionPlace.Text      = myClass_IssueDefault.SupervisionPlace;
                    this.NumericUpDown_OriginalPeriod.Value = myClass_IssueDefault.PeriodofValidity;
                    this.textBox_KindofEmployer.Text        = myClass_IssueDefault.KindofEmployer;
                    if (!string.IsNullOrEmpty(myClass_IssueDefault.EmployerHPID))
                    {
                        Class_Employer myClass_Employer = new Class_Employer(myClass_IssueDefault.EmployerHPID);
                        this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer);
                    }
                    this.myClass_Issue.KindofEmployer = myClass_IssueDefault.KindofEmployer;
                    this.myClass_Issue.EmployerHPID   = myClass_IssueDefault.EmployerHPID;
                }

                Class_CustomUser myClass_CustomUser = new Class_CustomUser();
                if (!string.IsNullOrEmpty(Properties.Settings.Default.TheoryTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.TheoryTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
                if (!string.IsNullOrEmpty(Properties.Settings.Default.SkillTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.SkillTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_SkillTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
                if (!string.IsNullOrEmpty(Properties.Settings.Default.SupervisorID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.SupervisorID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_SupervisorID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
                if (!string.IsNullOrEmpty(Properties.Settings.Default.IssueQCTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.IssueQCTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_IssueQCTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
                if (!string.IsNullOrEmpty(Properties.Settings.Default.ArchiveTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.ArchiveTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
            }
            else
            {
                this.MaskedTextBox_IssueNo.Text      = myClass_Issue.IssueNo;
                this.TextBox_IssueRemark.Text        = myClass_Issue.IssueRemark;
                this.DateTimePicker_SignUpDate.Value = myClass_Issue.SignUpDate;
                this.textBox_KindofEmployer.Text     = myClass_Issue.KindofEmployer;
                Class_Employer myClass_Employer = new Class_Employer(myClass_Issue.EmployerHPID);
                this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer);
                this.ComboBox_WeldingProcess.SelectedValue = myClass_Issue.WeldingProcessAb;

                this.InitControlWeldingParameter(this.myClass_Issue.myClass_WeldingParameter);

                Class_CustomUser myClass_CustomUser = new Class_CustomUser();
                myClass_CustomUser.UserGUID = myClass_Issue.TheoryTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                myClass_CustomUser.UserGUID = myClass_Issue.ArchiveTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                myClass_CustomUser.UserGUID = myClass_Issue.SkillTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_SkillTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                myClass_CustomUser.UserGUID = myClass_Issue.SupervisorID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_SupervisorID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                myClass_CustomUser.UserGUID = myClass_Issue.IssueQCTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_IssueQCTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                this.TextBox_PlaceofTest.Text = myClass_Issue.PlaceofTest;


                if (myClass_Issue.TheoryExamDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_TheoryExamDate.Text = myClass_Issue.TheoryExamDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.TheoryMakeupDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_TheoryMakeupDate.Text = myClass_Issue.TheoryMakeupDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.SkillExamDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_SkillExamDate.Text = myClass_Issue.SkillExamDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.SkillMakeupDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_SkillMakeupDate.Text = myClass_Issue.SkillMakeupDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.DateBeginningofTrain != DateTime.MinValue)
                {
                    this.MaskedTextBox_DateBeginningofTrain.Text = myClass_Issue.DateBeginningofTrain.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.DateEndingofTrain != DateTime.MinValue)
                {
                    this.MaskedTextBox_DateEndingofTrain.Text = myClass_Issue.DateEndingofTrain.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.VisualTestDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_VisualTestDate.Text = myClass_Issue.VisualTestDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.BendTestDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_BendTestDate.Text = myClass_Issue.BendTestDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.RTTestDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_RTTestDate.Text = myClass_Issue.RTTestDate.ToString("yyyy-MM-dd");
                }
                if (myClass_Issue.IssueIssuedOn != DateTime.MinValue)
                {
                    this.MaskedTextBox_IssuedOn.Text = myClass_Issue.IssueIssuedOn.ToString("yyyy-MM-dd");
                }
                this.TextBox_SupervisionPlace.Text = myClass_Issue.SupervisionPlace;
                if (myClass_Issue.PeriodofValidity >= this.NumericUpDown_OriginalPeriod.Minimum && myClass_Issue.PeriodofValidity <= this.NumericUpDown_OriginalPeriod.Maximum)
                {
                    this.NumericUpDown_OriginalPeriod.Value = myClass_Issue.PeriodofValidity;
                }

                this.CheckBox_TheoryTrained.Checked    = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 0);
                this.CheckBox_TheoryExam.Checked       = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 1);
                this.CheckBox_TheoryExamMakeup.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 4);
                this.CheckBox_SkillTrained.Checked     = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 6);
                this.CheckBox_SkillExam.Checked        = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 7);
                this.CheckBox_SkillExamMakeup.Checked  = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 10);
                this.CheckBox_Certificated.Checked     = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 14);
                this.CheckBox_Finished.Checked         = Class_DataValidateTool.CheckUintBit(this.myClass_Issue.IssueStatus, 31);
            }
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="myClass_GXTheoryIssue"></param>
        /// <param name="bool_Add"></param>
        public void InitControl(Class_GXTheoryIssue myClass_GXTheoryIssue, bool bool_Add)
        {
            this.myClass_GXTheoryIssue = myClass_GXTheoryIssue;
            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.textBox_ShipClassificationAb.Text = this.myClass_GXTheoryIssue.ShipClassificationAb;
            this.TextBox_ShipboardNo.Text          = this.myClass_GXTheoryIssue.ShipboardNo;

            if (bool_Add)
            {
                Class_Ship myClass_Ship = new Class_Ship(this.myClass_GXTheoryIssue.ShipboardNo);
                this.MaskedTextBox_IssueNo.Text = myClass_Ship.NextTheoryIssueNo;

                if (myClass_GXTheoryIssueDefault != null)
                {
                    this.ComboBox_WeldingProcess.SelectedValue = myClass_GXTheoryIssueDefault.WeldingProcessAb;
                    this.ComboBox_KindofExam.SelectedValue     = myClass_GXTheoryIssueDefault.KindofExam;
                    this.TextBox_PlaceofTest.Text    = myClass_GXTheoryIssueDefault.PlaceofTest;
                    this.textBox_KindofEmployer.Text = myClass_GXTheoryIssueDefault.KindofEmployer;
                    Class_Employer myClass_Employer = new Class_Employer(myClass_GXTheoryIssueDefault.EmployerHPID);
                    this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer);
                    this.myClass_GXTheoryIssue.KindofEmployer = myClass_GXTheoryIssueDefault.KindofEmployer;
                    this.myClass_GXTheoryIssue.EmployerHPID   = myClass_GXTheoryIssueDefault.EmployerHPID;
                }

                Class_CustomUser myClass_CustomUser = new Class_CustomUser();
                if (!string.IsNullOrEmpty(Properties.Settings.Default.TheoryTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.TheoryTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
                if (!string.IsNullOrEmpty(Properties.Settings.Default.ArchiveTeacherID))
                {
                    myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.ArchiveTeacherID);
                    if (myClass_CustomUser.FillData())
                    {
                        this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                    }
                }
            }
            else
            {
                this.MaskedTextBox_IssueNo.Text      = myClass_GXTheoryIssue.IssueNo;
                this.TextBox_IssueRemark.Text        = myClass_GXTheoryIssue.IssueRemark;
                this.DateTimePicker_SignUpDate.Value = myClass_GXTheoryIssue.SignUpDate;
                this.textBox_KindofEmployer.Text     = myClass_GXTheoryIssue.KindofEmployer;
                Class_Employer myClass_Employer = new Class_Employer(myClass_GXTheoryIssue.EmployerHPID);
                this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer);
                this.ComboBox_WeldingProcess.SelectedValue = myClass_GXTheoryIssue.WeldingProcessAb;
                this.ComboBox_KindofExam.SelectedValue     = myClass_GXTheoryIssue.KindofExam;

                Class_CustomUser myClass_CustomUser = new Class_CustomUser();
                myClass_CustomUser.UserGUID = myClass_GXTheoryIssue.TheoryTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                myClass_CustomUser.UserGUID = myClass_GXTheoryIssue.ArchiveTeacherID;
                if (myClass_CustomUser.FillData())
                {
                    this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString());
                }
                this.TextBox_PlaceofTest.Text = myClass_GXTheoryIssue.PlaceofTest;


                if (myClass_GXTheoryIssue.TheoryExamDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_TheoryExamDate.Text = myClass_GXTheoryIssue.TheoryExamDate.ToString("yyyy-MM-dd");
                }
                if (myClass_GXTheoryIssue.TheoryMakeupDate != DateTime.MinValue)
                {
                    this.MaskedTextBox_TheoryMakeupDate.Text = myClass_GXTheoryIssue.TheoryMakeupDate.ToString("yyyy-MM-dd");
                }
                if (myClass_GXTheoryIssue.DateBeginningofTrain != DateTime.MinValue)
                {
                    this.MaskedTextBox_DateBeginningofTrain.Text = myClass_GXTheoryIssue.DateBeginningofTrain.ToString("yyyy-MM-dd");
                }
                if (myClass_GXTheoryIssue.DateEndingofTrain != DateTime.MinValue)
                {
                    this.MaskedTextBox_DateEndingofTrain.Text = myClass_GXTheoryIssue.DateEndingofTrain.ToString("yyyy-MM-dd");
                }

                this.CheckBox_TheoryTrained.Checked    = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 0);
                this.CheckBox_TheoryExam.Checked       = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 1);
                this.CheckBox_TheoryExamMakeup.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 4);
                this.CheckBox_Finished.Checked         = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 31);
            }
        }