/// <summary>
 /// 删除数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e)
 {
     if (this.myEventArgs_ShipClassification.bool_GXTheory)
     {
         if (Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete))
         {
             if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.Delete);
                 this.RefreshData(false);
             }
         }
         else
         {
             MessageBox.Show("不能删除!");
         }
     }
     else
     {
         if (Class_Issue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete))
         {
             if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 Class_Issue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.Delete);
                 this.RefreshData(false);
             }
         }
         else
         {
             MessageBox.Show("不能删除!");
         }
     }
 }
示例#2
0
 private void Form_IssueUpdate_Load(object sender, EventArgs e)
 {
     if (!(this.bool_Add || Class_Issue.ExistAndCanDeleteAndDelete(myClass_Issue.IssueNo, 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_IssueBase1.InitControl(this.myClass_Issue, this.bool_Add);
 }
示例#3
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));
            }
        }