接害类型维护中加入岗前、中、后,应急分类,添加了国标字段多

dhzzyy
luoxingjian 6 months ago
parent 597d33c131
commit a412b3a824
  1. 8
      PEIS/Entity/DictHazardTypecs.cs
  2. 261
      PEIS/View/Setting/HazardTypeForm.Designer.cs
  3. 30
      PEIS/View/Setting/HazardTypeForm.cs

@ -13,6 +13,10 @@ namespace PEIS.Entity
{ {
public override string TableName => "Dict_HazardType"; public override string TableName => "Dict_HazardType";
/// <summary> /// <summary>
/// ParentID
/// </summary>
public Int64 ParentID { get; set; }
/// <summary>
/// 名字 /// 名字
/// </summary> /// </summary>
public String Name { get; set; } public String Name { get; set; }
@ -24,6 +28,10 @@ namespace PEIS.Entity
/// 排序 /// 排序
/// </summary> /// </summary>
public int Sort { get; set; } public int Sort { get; set; }
/// <summary>
/// 国标
/// </summary>
public string Standard { get; set; }
} }
} }

@ -29,23 +29,24 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.gCHazardType = new DevExpress.XtraGrid.GridControl(); this.treeList1 = new DevExpress.XtraTreeList.TreeList();
this.gVHazardType = new DevExpress.XtraGrid.Views.Grid.GridView(); this.trID = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.ID = new DevExpress.XtraGrid.Columns.GridColumn(); this.trParentID = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.gcName = new DevExpress.XtraGrid.Columns.GridColumn(); this.trName = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.gcCode = new DevExpress.XtraGrid.Columns.GridColumn(); this.trCode = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.gcSort = new DevExpress.XtraGrid.Columns.GridColumn(); this.trSort = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.trStandard = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.opMenuHdType = new PEIS.View.UControl.OpMenu(); this.opMenuHdType = new PEIS.View.UControl.OpMenu();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.gCHFeelItem = new DevExpress.XtraGrid.GridControl(); this.gCHFeelItem = new DevExpress.XtraGrid.GridControl();
this.gVHFeelItem = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gVHFeelItem = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemCode2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.Sort = new DevExpress.XtraGrid.Columns.GridColumn(); this.Sort = new DevExpress.XtraGrid.Columns.GridColumn();
this.HID = new DevExpress.XtraGrid.Columns.GridColumn(); this.HID = new DevExpress.XtraGrid.Columns.GridColumn();
this.FID = new DevExpress.XtraGrid.Columns.GridColumn(); this.FID = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemName2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.FeeItemName2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemCode2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.ItemClass2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.ItemClass2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.SettlePrice2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.SettlePrice2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.Price2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.Price2 = new DevExpress.XtraGrid.Columns.GridColumn();
@ -62,6 +63,7 @@
this.KeyNo = new DevExpress.XtraGrid.Columns.GridColumn(); this.KeyNo = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemCode = new DevExpress.XtraGrid.Columns.GridColumn(); this.FeeItemCode = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemName = new DevExpress.XtraGrid.Columns.GridColumn(); this.FeeItemName = new DevExpress.XtraGrid.Columns.GridColumn();
this.FeeItemCode22 = new DevExpress.XtraGrid.Columns.GridColumn();
this.ItemClass = new DevExpress.XtraGrid.Columns.GridColumn(); this.ItemClass = new DevExpress.XtraGrid.Columns.GridColumn();
this.SettlePrice = new DevExpress.XtraGrid.Columns.GridColumn(); this.SettlePrice = new DevExpress.XtraGrid.Columns.GridColumn();
this.Price = new DevExpress.XtraGrid.Columns.GridColumn(); this.Price = new DevExpress.XtraGrid.Columns.GridColumn();
@ -73,13 +75,11 @@
this.panel4 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel();
this.opMenuItem = new PEIS.View.UControl.OpMenu(); this.opMenuItem = new PEIS.View.UControl.OpMenu();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.FeeItemCode22 = new DevExpress.XtraGrid.Columns.GridColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gCHazardType)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gVHazardType)).BeginInit();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gCHFeelItem)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gCHFeelItem)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gVHFeelItem)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gVHFeelItem)).BeginInit();
@ -99,7 +99,7 @@
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
this.splitContainer1.Panel1.AutoScroll = true; this.splitContainer1.Panel1.AutoScroll = true;
this.splitContainer1.Panel1.Controls.Add(this.gCHazardType); this.splitContainer1.Panel1.Controls.Add(this.treeList1);
this.splitContainer1.Panel1.Controls.Add(this.panel2); this.splitContainer1.Panel1.Controls.Add(this.panel2);
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
@ -110,84 +110,101 @@
this.splitContainer1.SplitterDistance = 266; this.splitContainer1.SplitterDistance = 266;
this.splitContainer1.TabIndex = 0; this.splitContainer1.TabIndex = 0;
// //
// gCHazardType // treeList1
// //
this.gCHazardType.Dock = System.Windows.Forms.DockStyle.Fill; this.treeList1.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
this.gCHazardType.Location = new System.Drawing.Point(0, 46); this.trID,
this.gCHazardType.MainView = this.gVHazardType; this.trParentID,
this.gCHazardType.Name = "gCHazardType"; this.trName,
this.gCHazardType.Size = new System.Drawing.Size(266, 697); this.trCode,
this.gCHazardType.TabIndex = 1; this.trSort,
this.gCHazardType.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.trStandard});
this.gVHazardType}); this.treeList1.Dock = System.Windows.Forms.DockStyle.Fill;
// this.treeList1.Location = new System.Drawing.Point(0, 46);
// gVHazardType this.treeList1.Name = "treeList1";
// this.treeList1.OptionsView.AutoWidth = false;
this.gVHazardType.Appearance.ViewCaption.Options.UseTextOptions = true; this.treeList1.Size = new System.Drawing.Size(266, 697);
this.gVHazardType.Appearance.ViewCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; this.treeList1.TabIndex = 1;
this.gVHazardType.Appearance.ViewCaption.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; //
this.gVHazardType.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { // trID
this.ID, //
this.gcName, this.trID.Caption = "trID";
this.gcCode, this.trID.FieldName = "ID";
this.gcSort}); this.trID.Name = "trID";
this.gVHazardType.GridControl = this.gCHazardType; this.trID.OptionsColumn.AllowEdit = false;
this.gVHazardType.Name = "gVHazardType"; this.trID.OptionsColumn.AllowFocus = false;
this.gVHazardType.OptionsView.ShowGroupPanel = false; this.trID.OptionsColumn.AllowSort = false;
this.gVHazardType.OptionsView.ShowPreviewRowLines = DevExpress.Utils.DefaultBoolean.False; this.trID.OptionsFilter.AllowAutoFilter = false;
this.gVHazardType.OptionsView.ShowVerticalLines = DevExpress.Utils.DefaultBoolean.False; this.trID.OptionsFilter.AllowFilter = false;
this.gVHazardType.ViewCaption = "接害类型"; //
// // trParentID
// ID //
// this.trParentID.Caption = "ParentID";
this.ID.Caption = "主键"; this.trParentID.FieldName = "ParentID";
this.ID.FieldName = "ID"; this.trParentID.Name = "trParentID";
this.ID.Name = "ID"; this.trParentID.OptionsColumn.AllowEdit = false;
this.ID.OptionsColumn.AllowEdit = false; this.trParentID.OptionsColumn.AllowFocus = false;
this.ID.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; this.trParentID.OptionsColumn.AllowSize = false;
this.ID.OptionsFilter.AllowAutoFilter = false; this.trParentID.OptionsColumn.AllowSort = false;
this.ID.OptionsFilter.AllowFilter = false; this.trParentID.OptionsFilter.AllowAutoFilter = false;
// this.trParentID.OptionsFilter.AllowFilter = false;
// gcName //
// // trName
this.gcName.Caption = "名字"; //
this.gcName.FieldName = "Name"; this.trName.Caption = "名称";
this.gcName.Name = "gcName"; this.trName.FieldName = "Name";
this.gcName.OptionsColumn.AllowEdit = false; this.trName.Name = "trName";
this.gcName.OptionsColumn.AllowFocus = false; this.trName.OptionsColumn.AllowEdit = false;
this.gcName.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.True; this.trName.OptionsColumn.AllowFocus = false;
this.gcName.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; this.trName.OptionsColumn.AllowSize = false;
this.gcName.OptionsFilter.AllowAutoFilter = false; this.trName.OptionsColumn.AllowSort = false;
this.gcName.OptionsFilter.AllowFilter = false; this.trName.OptionsFilter.AllowAutoFilter = false;
this.gcName.Visible = true; this.trName.OptionsFilter.AllowFilter = false;
this.gcName.VisibleIndex = 0; this.trName.Visible = true;
this.gcName.Width = 188; this.trName.VisibleIndex = 0;
// this.trName.Width = 250;
// gcCode //
// // trCode
this.gcCode.Caption = "编码"; //
this.gcCode.FieldName = "Code"; this.trCode.Caption = "编码";
this.gcCode.Name = "gcCode"; this.trCode.FieldName = "Code";
this.gcCode.OptionsColumn.AllowEdit = false; this.trCode.Name = "trCode";
this.gcCode.OptionsColumn.AllowFocus = false; this.trCode.OptionsColumn.AllowEdit = false;
this.gcCode.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; this.trCode.OptionsColumn.AllowFocus = false;
this.gcCode.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; this.trCode.OptionsColumn.AllowSize = false;
this.gcCode.OptionsFilter.AllowAutoFilter = false; this.trCode.OptionsColumn.AllowSort = false;
this.gcCode.OptionsFilter.AllowFilter = false; this.trCode.OptionsFilter.AllowAutoFilter = false;
this.gcCode.Visible = true; this.trCode.OptionsFilter.AllowFilter = false;
this.gcCode.VisibleIndex = 1; this.trCode.Visible = true;
this.gcCode.Width = 60; this.trCode.VisibleIndex = 1;
// this.trCode.Width = 100;
// gcSort //
// // trSort
this.gcSort.Caption = "排序"; //
this.gcSort.FieldName = "Sort"; this.trSort.Caption = "排序";
this.gcSort.Name = "gcSort"; this.trSort.FieldName = "Sort";
this.gcSort.OptionsColumn.AllowEdit = false; this.trSort.Name = "trSort";
this.gcSort.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; this.trSort.OptionsColumn.AllowEdit = false;
this.gcSort.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; this.trSort.OptionsColumn.AllowFocus = false;
this.gcSort.OptionsFilter.AllowAutoFilter = false; this.trSort.OptionsColumn.AllowSize = false;
this.gcSort.OptionsFilter.AllowFilter = false; this.trSort.OptionsColumn.AllowSort = false;
this.trSort.OptionsFilter.AllowAutoFilter = false;
this.trSort.OptionsFilter.AllowFilter = false;
//
// trStandard
//
this.trStandard.Caption = "国标";
this.trStandard.FieldName = "Standard";
this.trStandard.Name = "trStandard";
this.trStandard.OptionsColumn.AllowEdit = false;
this.trStandard.OptionsColumn.AllowFocus = false;
this.trStandard.OptionsColumn.AllowSize = false;
this.trStandard.OptionsColumn.AllowSort = false;
this.trStandard.OptionsFilter.AllowAutoFilter = false;
this.trStandard.OptionsFilter.AllowFilter = false;
this.trStandard.Visible = true;
this.trStandard.VisibleIndex = 2;
this.trStandard.Width = 120;
// //
// panel2 // panel2
// //
@ -268,19 +285,6 @@
this.gridColumn1.OptionsFilter.AllowAutoFilter = false; this.gridColumn1.OptionsFilter.AllowAutoFilter = false;
this.gridColumn1.OptionsFilter.AllowFilter = false; this.gridColumn1.OptionsFilter.AllowFilter = false;
// //
// FeeItemCode2
//
this.FeeItemCode2.Caption = "项目编码";
this.FeeItemCode2.FieldName = "FeeItemCode";
this.FeeItemCode2.Name = "FeeItemCode2";
this.FeeItemCode2.OptionsColumn.AllowEdit = false;
this.FeeItemCode2.OptionsColumn.AllowFocus = false;
this.FeeItemCode2.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.FeeItemCode2.OptionsFilter.AllowAutoFilter = false;
this.FeeItemCode2.OptionsFilter.AllowFilter = false;
this.FeeItemCode2.Visible = true;
this.FeeItemCode2.VisibleIndex = 1;
//
// Sort // Sort
// //
this.Sort.Caption = "顺序"; this.Sort.Caption = "顺序";
@ -329,6 +333,19 @@
this.FeeItemName2.VisibleIndex = 0; this.FeeItemName2.VisibleIndex = 0;
this.FeeItemName2.Width = 174; this.FeeItemName2.Width = 174;
// //
// FeeItemCode2
//
this.FeeItemCode2.Caption = "项目编码";
this.FeeItemCode2.FieldName = "FeeItemCode";
this.FeeItemCode2.Name = "FeeItemCode2";
this.FeeItemCode2.OptionsColumn.AllowEdit = false;
this.FeeItemCode2.OptionsColumn.AllowFocus = false;
this.FeeItemCode2.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.FeeItemCode2.OptionsFilter.AllowAutoFilter = false;
this.FeeItemCode2.OptionsFilter.AllowFilter = false;
this.FeeItemCode2.Visible = true;
this.FeeItemCode2.VisibleIndex = 1;
//
// ItemClass2 // ItemClass2
// //
this.ItemClass2.Caption = "项目类别"; this.ItemClass2.Caption = "项目类别";
@ -539,6 +556,18 @@
this.FeeItemName.VisibleIndex = 0; this.FeeItemName.VisibleIndex = 0;
this.FeeItemName.Width = 170; this.FeeItemName.Width = 170;
// //
// FeeItemCode22
//
this.FeeItemCode22.Caption = "项目编码";
this.FeeItemCode22.FieldName = "FeeItemCode";
this.FeeItemCode22.Name = "FeeItemCode22";
this.FeeItemCode22.OptionsColumn.AllowEdit = false;
this.FeeItemCode22.OptionsColumn.AllowFocus = false;
this.FeeItemCode22.OptionsFilter.AllowAutoFilter = false;
this.FeeItemCode22.OptionsFilter.AllowFilter = false;
this.FeeItemCode22.Visible = true;
this.FeeItemCode22.VisibleIndex = 1;
//
// ItemClass // ItemClass
// //
this.ItemClass.Caption = "项目类别"; this.ItemClass.Caption = "项目类别";
@ -678,18 +707,6 @@
this.label3.Text = "检查项目"; this.label3.Text = "检查项目";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// FeeItemCode22
//
this.FeeItemCode22.Caption = "项目编码";
this.FeeItemCode22.FieldName = "FeeItemCode";
this.FeeItemCode22.Name = "FeeItemCode22";
this.FeeItemCode22.OptionsColumn.AllowEdit = false;
this.FeeItemCode22.OptionsColumn.AllowFocus = false;
this.FeeItemCode22.OptionsFilter.AllowAutoFilter = false;
this.FeeItemCode22.OptionsFilter.AllowFilter = false;
this.FeeItemCode22.Visible = true;
this.FeeItemCode22.VisibleIndex = 1;
//
// HazardTypeForm // HazardTypeForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
@ -704,8 +721,7 @@
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gCHazardType)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gVHazardType)).EndInit();
this.panel2.ResumeLayout(false); this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gCHFeelItem)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gCHFeelItem)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gVHFeelItem)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gVHFeelItem)).EndInit();
@ -723,12 +739,6 @@
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private DevExpress.XtraGrid.GridControl gCHazardType;
private DevExpress.XtraGrid.Views.Grid.GridView gVHazardType;
private DevExpress.XtraGrid.Columns.GridColumn ID;
private DevExpress.XtraGrid.Columns.GridColumn gcName;
private DevExpress.XtraGrid.Columns.GridColumn gcCode;
private DevExpress.XtraGrid.Columns.GridColumn gcSort;
private DevExpress.XtraGrid.GridControl gCHFeelItem; private DevExpress.XtraGrid.GridControl gCHFeelItem;
private DevExpress.XtraGrid.Views.Grid.GridView gVHFeelItem; private DevExpress.XtraGrid.Views.Grid.GridView gVHFeelItem;
private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel3;
@ -766,5 +776,12 @@
private DevExpress.XtraGrid.Columns.GridColumn UnitName2; private DevExpress.XtraGrid.Columns.GridColumn UnitName2;
private DevExpress.XtraGrid.Columns.GridColumn DeptName2; private DevExpress.XtraGrid.Columns.GridColumn DeptName2;
private DevExpress.XtraGrid.Columns.GridColumn FeeItemCode22; private DevExpress.XtraGrid.Columns.GridColumn FeeItemCode22;
private DevExpress.XtraTreeList.TreeList treeList1;
private DevExpress.XtraTreeList.Columns.TreeListColumn trID;
private DevExpress.XtraTreeList.Columns.TreeListColumn trParentID;
private DevExpress.XtraTreeList.Columns.TreeListColumn trName;
private DevExpress.XtraTreeList.Columns.TreeListColumn trCode;
private DevExpress.XtraTreeList.Columns.TreeListColumn trSort;
private DevExpress.XtraTreeList.Columns.TreeListColumn trStandard;
} }
} }

@ -1,4 +1,5 @@
using PEIS.Base; using DevExpress.XtraTreeList.Nodes;
using PEIS.Base;
using PEIS.Entity; using PEIS.Entity;
using PEIS.Event; using PEIS.Event;
using PEIS.Presenter; using PEIS.Presenter;
@ -29,7 +30,8 @@ namespace PEIS.View.Setting
opMenuHdType.TstbKey.TextChanged += TstbKey_TextChanged; opMenuHdType.TstbKey.TextChanged += TstbKey_TextChanged;
opMenuHdType.TsmiRefresh.Click += TsmiRefresh_Click; opMenuHdType.TsmiRefresh.Click += TsmiRefresh_Click;
gVHazardType.FocusedRowChanged += GVHazardType_FocusedRowChanged; treeList1.FocusedNodeChanged += TreeList1_FocusedNodeChanged;
//gVHazardType.FocusedRowChanged += GVHazardType_FocusedRowChanged;
//关联菜单 //关联菜单
opMenuRelation.TsmiRefresh.Visible = true; opMenuRelation.TsmiRefresh.Visible = true;
opMenuRelation.TsmiAdd.Visible = false; opMenuRelation.TsmiAdd.Visible = false;
@ -54,6 +56,7 @@ namespace PEIS.View.Setting
Shown += HazardTypeForm_Shown; Shown += HazardTypeForm_Shown;
} }
private void HazardTypeForm_Shown(object sender, EventArgs e) private void HazardTypeForm_Shown(object sender, EventArgs e)
{ {
ThreadPool.QueueUserWorkItem(s => ThreadPool.QueueUserWorkItem(s =>
@ -70,25 +73,25 @@ namespace PEIS.View.Setting
public event EventHandler<Args<DictHazardType>> GetHazardTypeItem; public event EventHandler<Args<DictHazardType>> GetHazardTypeItem;
public void ShowHazardTypeItem(List<DictHazardType> hazardTypes) public void ShowHazardTypeItem(List<DictHazardType> hazardTypes)
{ {
Invoke(new Action(() => { gCHazardType.DataSource = null; gCHazardType.DataSource = hazardTypes;})); Invoke(new Action(() => { treeList1.DataSource = null; treeList1.DataSource = hazardTypes;}));
} }
private void TstbKey_TextChanged(object sender, EventArgs e) private void TstbKey_TextChanged(object sender, EventArgs e)
{ {
var textValue = (sender as ToolStripTextBox).Text; var textValue = (sender as ToolStripTextBox).Text;
if (!string.IsNullOrEmpty(textValue)&&!textValue.Equals("输入条件查询")) if (!string.IsNullOrEmpty(textValue)&&!textValue.Equals("输入条件查询"))
{ {
gVHazardType.ApplyFindFilter(textValue); treeList1.ApplyFindFilter(textValue);
} }
else else
{ {
gVHazardType.ApplyFindFilter(""); treeList1.ApplyFindFilter("");
} }
} }
private void TsmiRefresh_Click(object sender, EventArgs e) private void TsmiRefresh_Click(object sender, EventArgs e)
{ {
LoadHazardType(); LoadHazardType();
} }
private void GVHazardType_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) private void TreeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
{ {
LoadHTypeFItem(); LoadHTypeFItem();
} }
@ -112,13 +115,21 @@ namespace PEIS.View.Setting
{ {
int feeItemIndex = gVFeelItem.FocusedRowHandle; int feeItemIndex = gVFeelItem.FocusedRowHandle;
var feeItemRow = gVFeelItem.GetRow(feeItemIndex) as FeeItem; var feeItemRow = gVFeelItem.GetRow(feeItemIndex) as FeeItem;
int hazardTypeIndex=gVHazardType.FocusedRowHandle; //int hazardTypeIndex= treeList1.FocusedRowHandle;
var hazardTypeRow = gVHazardType.GetRow(hazardTypeIndex) as DictHazardType; //var hazardTypeRow = treeList1.GetRow(hazardTypeIndex) as DictHazardType;
var hazardTypeRow = treeList1.GetFocusedRow() as DictHazardType;
if (hazardTypeRow == null) if (hazardTypeRow == null)
{ {
Global.Msg("info", "没有接害类型"); Global.Msg("info", "没有接害类型");
return; return;
} }
TreeListNode selectedNode = treeList1.FocusedNode;
bool hasChildren = selectedNode.HasChildren;
if (hasChildren)
{
Global.Msg("info", "分类上不能添加项目");
return;
}
var HFeelItem= gCHFeelItem.DataSource as List<HTypeFItemInfo>; var HFeelItem= gCHFeelItem.DataSource as List<HTypeFItemInfo>;
var alradlyData=HFeelItem?.Where(p => p.FID == feeItemRow.ID).FirstOrDefault(); var alradlyData=HFeelItem?.Where(p => p.FID == feeItemRow.ID).FirstOrDefault();
if (alradlyData!=null) if (alradlyData!=null)
@ -148,8 +159,7 @@ namespace PEIS.View.Setting
} }
public void LoadHTypeFItem() public void LoadHTypeFItem()
{ {
int hazardTypeIndex = gVHazardType.FocusedRowHandle; var hazardTypeRow = treeList1.GetFocusedRow() as DictHazardType;
var hazardTypeRow = gVHazardType.GetRow(hazardTypeIndex) as DictHazardType;
if (hazardTypeRow!=null) if (hazardTypeRow!=null)
{ {
GetHTypeFItem?.Invoke(this, new Args<HTypeFItemInfo>() { Eid = hazardTypeRow.ID }); GetHTypeFItem?.Invoke(this, new Args<HTypeFItemInfo>() { Eid = hazardTypeRow.ID });

Loading…
Cancel
Save