private void BattleAreaData_Edit_Load(object sender, EventArgs e) { Dictionary <string, TableExplain> dlc = new Dictionary <string, TableExplain>(); string path = Path.Combine(ToolsHelper.ExplainPath, _tableName + ".xml"); if (File.Exists(path)) { dlc = DataHelper.GetTableExplainList(path); } ToolsHelper tl = new ToolsHelper(); tl.CreateCtr(DataHelper.XkfyData.Tables[_tableName], gbDrop, _dr, dlc, 12); if (_type == "Modify") { //修改 DataHelper.CopyRowToData(this, _dr); btnUpdate.Visible = true; } else if (_type == "Add") { //新增 btnAdd.Visible = true; } else { //复制新增 DataHelper.CopyRowToData(this, _dr); btnAdd.Visible = true; } }
private void Almighty_Edit_Load(object sender, EventArgs e) { try { DataTable dt = null; if (_fileType == "other") { dt = DataHelper.XkfyData.Tables[_tbName]; } else { dt = DataHelper.MapData.Tables[_tbName]; } Dictionary <string, TableExplain> dlc = new Dictionary <string, TableExplain>(); string path = string.Empty; if (_fileType == "MapInfo") { path = Path.Combine(ToolsHelper.ExplainPath, "MapInfo.xml"); } else if (_fileType == "NpcProduct") { path = Path.Combine(ToolsHelper.ExplainPath, "NpcProduct.xml"); } else { path = Path.Combine(ToolsHelper.ExplainPath, _tbName + ".xml"); } if (File.Exists(path)) { dlc = DataHelper.GetTableExplainList(path); } ToolsHelper tl = new ToolsHelper(); tl.CreateCtr(dt, this, _dr, dlc, toolTip); if (_type == "Modify") { btnUpdate.Visible = true; } else { btnAdd.Visible = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }