/// <summary> /// 刷新数据 /// </summary> /// <param name="bool_JustFill">true-只添加和修改数据,false-刷新全部数据</param> private void RefreshData(bool bool_JustFill) { if (this.myEventArgs_DataManager != null) { Publisher_DataManager.OnEventName(this.myEventArgs_DataManager); } }
private void button_Query_Click(object sender, EventArgs e) { if (this.dataGridView_Data.Tag == null) { return; } Form_QueryFilter myForm = new Form_QueryFilter(); myForm.InitControl(this.dataGridView_Data.Tag.ToString()); if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_DataManager my_e = new EventArgs_DataManager(this.myEventArgs_DataManager.str_DataManagerText, this.myEventArgs_DataManager.str_DataManagerName, this.myEventArgs_DataManager.str_DataManagerTag); my_e.str_Filter = myForm.str_Filter; Publisher_DataManager.OnEventName(my_e); } }
private void toolStripMenuItem_RowAddByExcel_Click(object sender, EventArgs e) { DataTable myDataTable = Class_DataControlBind.ImportExcelToDataTable(); if (myDataTable != null) { StringBuilder myStringBuilder = new StringBuilder(); if (myDataTable.Columns.Contains("CertificateNo")) { DataRow[] myDataRow_Range; myDataRow_Range = myDataTable.Select("len(CertificateNo)>0"); myStringBuilder.Append("1=0"); foreach (DataRow myDataRow in myDataRow_Range) { myStringBuilder.Append(string.Format(" Or CertificateNo='{0}'", myDataRow["CertificateNo"].ToString())); } } else if (myDataTable.Columns.Contains("ExaminingNo")) { DataRow[] myDataRow_Range; myDataRow_Range = myDataTable.Select("len(ExaminingNo)>0"); myStringBuilder.Append("1=0"); foreach (DataRow myDataRow in myDataRow_Range) { myStringBuilder.Append(string.Format(" Or ExaminingNo='{0}'", myDataRow["ExaminingNo"].ToString())); } } else { MessageBox.Show("数据表中不存在 'CertificateNo'或'ExaminingNo' 列!"); return; } EventArgs_DataManager my_e = new EventArgs_DataManager(this.myEventArgs_DataManager.str_DataManagerText, this.myEventArgs_DataManager.str_DataManagerName, this.myEventArgs_DataManager.str_DataManagerTag); my_e.str_Filter = myStringBuilder.ToString(); Publisher_DataManager.OnEventName(my_e); } }
private void treeView_Data_AfterSelect(object sender, TreeViewEventArgs e) { EventArgs_DataManager my_e = new EventArgs_DataManager((string)this.treeView_Data.SelectedNode.Text, this.treeView_Data.SelectedNode.Name, this.treeView_Data.SelectedNode.Tag.ToString()); Publisher_DataManager.OnEventName(my_e); }