private void InitDataGridView(object sender, EventArgs_Issue e) { this.myEventArgs_Issue = e; Class_Data myClass_Data; if (this.myEventArgs_Issue.bool_GXTheory == false) { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.SubjectPositionResult.ToString()]; this.dataGridView_Data.DataSource = null; myClass_Data.SetFilter(string.Format("IssueNo='{0}'", e.str_IssueNo)); myClass_Data.RefreshData(false); this.dataGridView_Data.DataSource = new DataView(myClass_Data.myDataTable.Copy()); if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } //((DataView)this.dataGridView_Data.DataSource).RowFilter = string.Format("ExaminingNo='{0}'", this.myEventArgs_Student .str_ExaminingNo); } else { this.dataGridView_Data.DataSource = null; } //this.label_Data.Text = string.Format("考试项目,({0}):", this.dataGridView_Data.RowCount); this.RefreshData(true); }
private void button_OnOK_Click(object sender, EventArgs e) { this.userControl_StudentBase1.FillClass(); String str_ErrMessage; str_ErrMessage = this.myClass_Student.CheckField(); if (str_ErrMessage != null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = str_ErrMessage; return; } if (this.bool_Add) { if (Class_Student.ExistSecond(this.myClass_Student.IssueNo, this.myClass_Student.IdentificationCard, null, Enum_zwjKindofUpdate.Add)) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = "身份证号码不能重复!"; return; } else { if (!this.myClass_Student.AddAndModify(Enum_zwjKindofUpdate.Add)) { this.label_ErrMessage.Text = "添加不成功,可能是考编号重复!"; this.DialogResult = DialogResult.None; return; } else { if (this.checkBox_Continuous.Checked) { EventArgs_Issue my_e = new EventArgs_Issue(this.myClass_Student.IssueNo, false); Publisher_Issue.OnEventName(my_e); this.label_ErrMessage.Text = ""; this.DialogResult = DialogResult.None; return; } else { this.DialogResult = DialogResult.OK; return; } } } } else { if (Class_Student.ExistSecond(this.myClass_Student.IssueNo, this.myClass_Student.IdentificationCard, this.myClass_Student.ExaminingNo, Enum_zwjKindofUpdate.Modify)) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = "身份证号码不能重复!"; return; } else { this.myClass_Student.AddAndModify(Enum_zwjKindofUpdate.Modify); } } }
/// <summary> /// 初始化数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InitDataGridView(object sender, EventArgs_Issue e) { this.myEventArgs_Issue = e; Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.IssueProcess.ToString(), false); Class_Data myClass_Data; if (this.myEventArgs_Issue.bool_GXTheory == false) { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.IssueProcess.ToString()]; } else { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.GXTheoryIssueProcess.ToString()]; } myClass_Data.SetFilter(string.Format("IssueNo='{0}'", e.str_IssueNo)); if (this.myEventArgs_Issue.bool_JustFill) { if (this.myDataTable.Rows.Count == 0) { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Issue.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } else { myClass_Data.RefreshData(this.myEventArgs_Issue.bool_JustFill, this.myDataTable); } } else { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Issue.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } if (this.treeView_IssueProcess.SelectedNode == null || this.treeView_IssueProcess.SelectedNode.Level == 0) { ((DataView)this.dataGridView_Data.DataSource).RowFilter = null; this.label_Data.Text = string.Format("全部({0}):", this.dataGridView_Data.RowCount); } else { ((DataView)this.dataGridView_Data.DataSource).RowFilter = string.Format("IssueProcessStatusGroup='{0}'", this.treeView_IssueProcess.SelectedNode.Tag.ToString()); this.label_Data.Text = string.Format("{0}({1}):", this.treeView_IssueProcess.SelectedNode.Text, this.dataGridView_Data.RowCount); } }
private void InitstatusStrip(object sender, EventArgs_Issue e) { this.toolStripStatusLabel_IssueNo.Text = string.Format("°à¼¶±àºÅ£º{0}", e.str_IssueNo); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InitDataGridView(object sender, EventArgs_ShipClassification e) { this.myEventArgs_ShipClassification = e; string str_Filter; if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_ShipClassificationAb)) { str_Filter = string.Format("ShipClassificationAb='{0}'", this.myEventArgs_ShipClassification.str_ShipClassificationAb); if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_ShipboardNo)) { str_Filter += string.Format(" And ShipboardNo='{0}'", this.myEventArgs_ShipClassification.str_ShipboardNo); //if (this.myEventArgs_ShipClassification.bool_GXTheory) //{ // Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.GXTheoryIssue.ToString()); // myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.GXTheoryIssue.ToString()]; //} } else if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_Year)) { str_Filter += string.Format(" And (SignUpDate >= '{0}-1-1' and SignUpDate<='{0}-12-31 23:59:59.997')", this.myEventArgs_ShipClassification.str_Year); } } else { str_Filter = this.myEventArgs_ShipClassification.str_Filter; } Class_Data myClass_Data; if (this.myEventArgs_ShipClassification.bool_GXTheory) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.GXTheoryIssue.ToString(), false); myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.GXTheoryIssue.ToString()]; } else { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.Issue.ToString(), false); myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Issue.ToString()]; } if (Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("焊工权限"), Enum_zwjKindofUpdate.Read)) { } else if (Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("报考权限"), Enum_zwjKindofUpdate.Read)) { Class_Data myClass_Data_KindofEmployer = (Class_Data)Class_Public.myHashtable[Enum_DataTable.KindofEmployer.ToString()]; string str_Filter_KindofEmployer = "(1=0"; foreach (DataRowView myDataRowView_KindofEmployer in myClass_Data_KindofEmployer.myDataView) { Class_KindofEmployer myClass_KindofEmployer = new Class_KindofEmployer(myDataRowView_KindofEmployer["KindofEmployer"].ToString()); if (myClass_KindofEmployer.KindofEmployerManagerID.Equals(Class_zwjPublic.myClass_CustomUser.UserGUID)) { str_Filter_KindofEmployer += string.Format(" or KindofEmployer='{0}'", myClass_KindofEmployer.KindofEmployer); } } str_Filter_KindofEmployer += ")"; str_Filter = str_Filter_KindofEmployer + " and (" + str_Filter + ")"; } myClass_Data.SetFilter(str_Filter); if (this.myEventArgs_ShipClassification.bool_JustFill) { if (this.myDataTable.Rows.Count == 0) { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; if (this.dataGridView_Data.Rows.Count > 0) { this.dataGridView_Data.CurrentCell = this.dataGridView_Data.Rows[this.dataGridView_Data.Rows.Count - 1].Cells["IssueNo"]; } } else { myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill, this.myDataTable); } } else { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; if (this.dataGridView_Data.Rows.Count > 0) { this.dataGridView_Data.CurrentCell = this.dataGridView_Data.Rows[this.dataGridView_Data.Rows.Count - 1].Cells["IssueNo"]; } } if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } this.label_Data.Text = string.Format("班级,({0}):", this.dataGridView_Data.RowCount); if (this.dataGridView_Data.RowCount == 0) { EventArgs_Issue my_e = new EventArgs_Issue(null, this.myEventArgs_ShipClassification.bool_GXTheory); Publisher_Issue.OnEventName(my_e); } }
private void dataGridView_Data_RowEnter(object sender, DataGridViewCellEventArgs e) { EventArgs_Issue my_e = new EventArgs_Issue(this.dataGridView_Data.Rows[e.RowIndex].Cells["IssueNo"].Value.ToString(), this.myEventArgs_ShipClassification.bool_GXTheory); Publisher_Issue.OnEventName(my_e); }