/// <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("不能删除!"); } } }
private void toolStripMenuItem_RowTransferToGXTheoryIssue_Click(object sender, EventArgs e) { Form_GXTheoryIssue_Query myForm = new Form_GXTheoryIssue_Query(); myForm.myClass_GXTheoryIssue = new Class_GXTheoryIssue(); if (!string.IsNullOrEmpty(this.str_IssueNo)) { myForm.myClass_GXTheoryIssue.IssueNo = this.str_IssueNo; myForm.myClass_GXTheoryIssue.FillData(); } if (myForm.ShowDialog() == DialogResult.OK) { this.str_IssueNo = myForm.myClass_GXTheoryIssue.IssueNo; } else { return; } if (Class_GXTheoryIssue.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_GXTheoryStudent myClass_GXTheoryStudent = new Class_GXTheoryStudent(); myClass_GXTheoryStudent.IssueNo = this.str_IssueNo; myClass_GXTheoryStudent.IdentificationCard = myClass_KindofEmployerWelder.IdentificationCard; myClass_GXTheoryStudent.SubjectID = myClass_KindofEmployerStudent.ExamSubjectID; Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(myClass_GXTheoryStudent.IssueNo); myClass_GXTheoryStudent.KindofExam = myClass_GXTheoryIssue.KindofExam; string str_ReturnMessage; str_ReturnMessage = myClass_GXTheoryStudent.CheckField(); if (string.IsNullOrEmpty(str_ReturnMessage)) { Class_KindofEmployerWelder.TransferWelder(myClass_KindofEmployerStudent.KindofEmployerWelderID); myClass_GXTheoryStudent.AddAndModify(Enum_zwjKindofUpdate.Add); if (string.IsNullOrEmpty(myClass_GXTheoryStudent.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_GXTheoryStudent.ExaminingNo)); } } else { MessageBox.Show(string.Format("编入理论班级失败,{0}!", str_ReturnMessage)); } } else { MessageBox.Show(string.Format("不存在理论班级编号为 {0} 的班级!", this.str_IssueNo)); } }
private void Form_GXTheoryIssue_Update_Load(object sender, EventArgs e) { if (!(this.bool_Add || Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(myClass_GXTheoryIssue.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_GXTheoryIssue_Base1.InitControl(this.myClass_GXTheoryIssue, this.bool_Add); }