public override void OnClick() { if (m_Hook.UserTree.SelectedNode != null) { Exception eError; string DeID = m_Hook.UserTree.SelectedNode.TagString; if (DeID == null || DeID == "") { return; } if (m_Hook.UserTree.SelectedNode.Text == "遥感室") { MessageBox.Show("该科室为管理员科室,不可修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } FrmAddDepartment frmDepartment = new FrmAddDepartment(); frmDepartment.m_id = DeID; frmDepartment.m_FrmText = "更新科室"; frmDepartment.m_BtnText = "更新"; frmDepartment.m_IsUpdate = true; if (frmDepartment.ShowDialog() == DialogResult.OK) { if (this.WriteLog) { Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } ModuleOperator.DisplayUserTree("", m_Hook.UserTree, ref ModData.gisDb, out eError); if (eError != null) { ErrorHandle.ShowFrmErrorHandle("提示", eError.Message); return; } } } }
public override void OnClick() { if (m_Hook.UserTree.SelectedNode != null) { Exception eError; User user = m_Hook.UserTree.SelectedNode.Tag as User; if (user == null) { return; } AddUser frmUser = new AddUser(user); if (frmUser.ShowDialog() == DialogResult.OK) { if (this.WriteLog) { Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } ModuleOperator.DisplayUserTree("", m_Hook.UserTree, ref ModData.gisDb, out eError); if (eError != null) { ErrorHandle.ShowFrmErrorHandle("提示", eError.Message); return; } } } }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { frmQuerySlope pfrmQuerySlope = new frmQuerySlope("坡度"); pfrmQuerySlope.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pfrmQuerySlope.pMapControlDefault = m_Hook.MapControl; pfrmQuerySlope.initialization(); pfrmQuerySlope.Show(); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); } }
public override void OnClick() { if (m_Hook.RoleTree.SelectedNode != null) { Exception eError; Role role = m_Hook.RoleTree.SelectedNode.Tag as Role; if (role == null) { return; } AddGroup frmGroup = new AddGroup(role); if (frmGroup.ShowDialog() == DialogResult.OK) { if (this.WriteLog) { Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } ModuleOperator.DisplayRoleTree("", m_Hook.RoleTree, ref ModData.gisDb, out eError); if (eError != null) { ErrorHandle.ShowFrmErrorHandle("提示", eError.Message); } } } }
//函数功能:修改记录 //输入参数:无 输出参数:布尔型 //函数功能:根据用户填写向表中添加记录 //输入参数:无 输出参数:bool private bool Add() { try { if (GeoDataCenterFunLib.LogTable.m_sysTable == null) { return(false); } Dictionary <string, object> pDic = new Dictionary <string, object>(); Exception ex = null; ITable pTable = GeoDataCenterFunLib.LogTable.m_sysTable.OpenTable(m_TableName, out ex); if (pTable == null) { return(false); } pRow = pTable.CreateRow(); for (int i = 0; i < m_gridView.ColumnCount; i++) //显示新产生的记录ID给用户 { if (m_gridView.Columns[i].Name.ToUpper() == "ID") { m_TextBoxX[i].Text = pRow.OID.ToString(); ModDBOperate.oid = pRow.OID; break; } } } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", "修改记录失败!" + ex.Message); return(false); } return(true); }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("鹰眼图设置"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { FrmEditLayerSet fmMBMM = new FrmEditLayerSet(m_Hook.MapControl); fmMBMM.WriteLog = this.WriteLog; //int fmMBMMX = m_frmhook.MainForm.Location.X + m_frmhook.MainForm.Width - fmMBMM.Width; //int fmMBMMY = m_frmhook.MainForm.Location.Y + 100; //fmMBMM.SetDesktopLocation(fmMBMMX, fmMBMMY); if (fmMBMM.ShowDialog() == DialogResult.OK) { } } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", "配置文件editlayer.xml出错!缺少相关的属性。"); } }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { frm3DSection pfrm3DSection = new frm3DSection(); pfrm3DSection.pMapControlDefault = m_Hook.MapControl; pfrm3DSection.initialization(); pfrm3DSection.Show(); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); } }
public override void OnClick() { if (m_Hook.RoleTree.SelectedNode != null) { Exception eError; Role role = m_Hook.RoleTree.SelectedNode.Tag as Role; if (role == null) { return; } if (role.Name == "超级管理员") { ErrorHandle.ShowFrmErrorHandle("提示", "管理员不能删除!"); return; } if (ErrorHandle.ShowFrmInformation("确认", "取消", "确认删除?")) { if (ModuleOperator.DeleteData("role", "roleid", role.IDStr, ref ModData.gisDb, out eError)) { if (this.WriteLog) { Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } m_Hook.RoleTree.SelectedNode.Remove(); } else { if (eError != null) { ErrorHandle.ShowInform("提示", eError.Message); } } } } }
private void buttonXOK_Click(object sender, EventArgs e) { if (textBox_Jpg.Text == "" || textBox_XLS.Text == "") { MessageBox.Show("请设置成果数据目录信息!", "提示!"); return; } Exception exError = null; SysGisTable sysTable = new SysGisTable(m_Workspace); Dictionary <string, object> dicData = new Dictionary <string, object>(); dicData.Add("DATATYPE", "文档成果数据"); dicData.Add("DATAPATH", textBox_XLS.Text); //判断是更新还是添加 //不存在则添加,已存在则更新 if (!sysTable.ExistData("RESULTDIR", "DATATYPE='文档成果数据'")) { if (!sysTable.NewRow("RESULTDIR", dicData, out exError)) { ErrorHandle.ShowFrmErrorHandle("提示", "添加失败!"); } } else { if (MessageBox.Show("已经存在文档成果数据目录信息,是否进行更新", "提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (!sysTable.UpdateRow("RESULTDIR", "DATATYPE='文档成果数据'", dicData, out exError)) { ErrorHandle.ShowFrmErrorHandle("提示", "更新失败!"); } } } dicData = new Dictionary <string, object>(); dicData.Add("DATATYPE", "图件成果数据"); dicData.Add("DATAPATH", textBox_Jpg.Text); //判断是更新还是添加 //不存在则添加,已存在则更新 if (!sysTable.ExistData("RESULTDIR", "DATATYPE='图件成果数据'")) { if (!sysTable.NewRow("RESULTDIR", dicData, out exError)) { ErrorHandle.ShowFrmErrorHandle("提示", "添加失败!"); return; } } else { if (MessageBox.Show("已经存在图件成果数据目录信息,是否进行更新", "提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (!sysTable.UpdateRow("RESULTDIR", "DATATYPE='图件成果数据'", dicData, out exError)) { ErrorHandle.ShowFrmErrorHandle("提示", "更新失败!"); return; } } } sysTable = null; this.Close(); this.Dispose(true); }
//清空日志 public static void ClearLog(ListView lv) { if (m_sysTable == null) { return; } Exception err; ITable pTable = m_sysTable.OpenTable(m_LogNAME, out err); if (pTable == null) { MessageBox.Show(err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return;//若日志表不存在,返回null } //for (int i = 0; i < lv.Items.Count;i++ ) //{ // ListViewItem lvi = lv.Items[i]; // IQueryFilter pQF = new QueryFilterClass(); // pQF.WhereClause = "logTime = '" + lvi.SubItems[0].Text // + "' AND logUser = '******' AND logIP = '" + lvi.SubItems[1].Text // + "' AND logEVENT = '" + lvi.SubItems[3].Text+"'"; IWorkspace pWorkspace = m_gisDb.WorkSpace; ITransactions pTransactions = (ITransactions)pWorkspace; try { if (!pTransactions.InTransaction) { pTransactions.StartTransaction(); } } catch (Exception eX) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", eX.Message); return; } Exception exError; if (!m_sysTable.DeleteRows(m_LogNAME, "", out exError)) { ErrorHandle.ShowFrmErrorHandle("提示", "清空日志失败!" + exError.Message); return; } try { if (pTransactions.InTransaction) { pTransactions.CommitTransaction(); } } catch (Exception eX) { } //} }
private void btnOK_Click(object sender, EventArgs e) { if (txtGWX.Text == "X" || txtGWY.Text == "XX" || txtGWX.Text == "" || txtGWY.Text == "" || txtGWX.Text == "0" || txtGWY.Text == "0") { ErrorHandle.ShowFrmErrorHandle("提示", "请设置图幅号的高位数!"); return; } MapTextElements["图名"] = txtTitle.Text; MapTextElements["G50G005005"] = txtMapNO.Text; if (chkBoxSecurity.Checked) { MapTextElements["密级"] = cBoxSecret.Text; } MapTextElements["G50G004004"] = txtJTBWN.Text; MapTextElements["G50G004005"] = txtJTBN.Text; MapTextElements["G50G004006"] = txtJTBEN.Text; MapTextElements["G50G005004"] = txtJTBW.Text; MapTextElements["G50G005006"] = txtJTBE.Text; MapTextElements["G50G006004"] = txtJTBWS.Text; MapTextElements["G50G006005"] = txtJTBS.Text; MapTextElements["G50G006006"] = txtJTBES.Text; //MapTextElements["1995年5月XXX测图。"]=txtTime.Text; //MapTextElements["坐标系"]=cBoxCoordinate.Text; //MapTextElements["1985国家高程基准,"]=cBoxElevation.Text+","; //MapTextElements["等高距为1米。"]="等高距为"+txtContourIntvl.Text+"米"; //MapTextElements["1996年版图式。"]=txtVersionYear.Text+"年版图式。"; //MapTextElements["附注:"] = (txtCLY.Text=="")?"":"附注:"+txtCLY.Text; MapTextElements["测绘机关全称"] = txtCartoGroup.Text; MapTextElements["比例尺"] = "1:" + cBoxScale.Text; MapTextElements["比例尺2"] = "1:" + cBoxScale.Text; MapTextElements["左下角标注1"] = rTxtLeftLower.Text; MapTextElements["左下角标注2"] = txtVersionYear.Text; MapTextElements["右下角标注"] = rTxtRightLower.Text; MapTextElements["553.75左下"] = txtMapNO.Text.Trim().Split('-')[0]; MapTextElements["385.50左下"] = txtMapNO.Text.Trim().Split('-')[1]; MapTextElements["553.75右下"] = txtJTBE.Text.Trim().Split('-')[0]; MapTextElements["385.75右下"] = txtJTBE.Text.Trim().Split('-')[1]; MapTextElements["554.00左上"] = txtJTBN.Text.Trim().Split('-')[0]; MapTextElements["385.50左上"] = txtJTBN.Text.Trim().Split('-')[1]; MapTextElements["554.00右上"] = txtJTBEN.Text.Trim().Split('-')[0]; MapTextElements["385.75右上"] = txtJTBEN.Text.Trim().Split('-')[1]; MapTextElements["图名1"] = txtTitle.Text; MapTextElements["图号1"] = txtMapNO.Text; MapTextElements["图名2"] = txtTitle.Text; MapTextElements["图号2"] = txtMapNO.Text; MapTextElements["图名3"] = txtTitle.Text; MapTextElements["图号3"] = txtMapNO.Text; MapTextElements["图名4"] = txtTitle.Text; MapTextElements["图号4"] = txtMapNO.Text; //MapTextElements["测量员"] = "测量员:" + txtCLY.Text; //MapTextElements["绘图员"] = "绘图员:" + txtHTY.Text; //MapTextElements["检查员"] = "检查员:" + txtJCHY.Text; isChecked = true; CheckedTuli = checkBoxTuli.Checked;//xisheng 20110828 this.Close(); }
private void btnBakDir_Click(object sender, EventArgs e) { FolderBrowserDialog folder = new FolderBrowserDialog(); folder.Description = "还原目录:"; if (folder.ShowDialog() == DialogResult.OK) { lstRcUsr.Items.Clear(); lstRcUsr.Items.Add("SDE").SubItems.Add("SDE"); string str = folder.SelectedPath; this.txtRcDir.Text = str; //创建目录或更新对象 OleDbConnection conn = new OleDbConnection(connStr); conn.Open(); OleDbCommand pCmd = conn.CreateCommand(); pCmd.CommandText = "create or replace directory SDElogicbakdir as '" + txtRcDir.Text + "'"; try { pCmd.ExecuteNonQuery(); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } finally { conn.Close(); } //创建目录对象end try { Stream stmp = File.Open(txtRcDir.Text + "\\expdpUsers.dat", FileMode.Open); BinaryFormatter bf = new BinaryFormatter(); object o = bf.Deserialize(stmp); List <string> users = o as List <string>; stmp.Close(); foreach (string usr in users) { if (usr != "SDE") { lstRcUsr.Items.Add(usr).SubItems.Add(usr); } } } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } string[] fs = Directory.GetFiles(txtRcDir.Text.Trim(), "*.dmp", SearchOption.TopDirectoryOnly); System.Array.Sort(fs); foreach (string s in fs) { files += System.IO.Path.GetFileName(s) + ","; } files = files.Substring(0, files.Length - 1); } }
public override void OnClick() { if (_AppHk == null) { return; } if (_AppHk.MapControl == null) { return; } IMap pMap = _AppHk.MapControl.Map; if (frmSQL != null) { frmSQL.Close(); } if (this.WriteLog) { Plugin.LogTable.Writelog("河流查询");//xisheng 日志记录; } string strLayerName = ""; string strFieldName = ""; //名称字段 string strFieldCode = ""; //编码字段 IFeatureClass pRiverFeaClass = null; try {//查找河流地物类 ModQuery.GetQueryConfig("河流查询", out pRiverFeaClass, out strLayerName, out strFieldName, out strFieldCode); if (pRiverFeaClass == null) { MessageBox.Show("找不到河流数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //检查河流名称字段 if (pRiverFeaClass.FindField(strFieldName) < 0) { MessageBox.Show("找不到河流名称属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); pRiverFeaClass = null; return; } //检查河流编码字段 if (pRiverFeaClass.FindField(strFieldCode) < 0) { MessageBox.Show("找不到河流编码属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); pRiverFeaClass = null; return; } frmQueryRoad fmQD = new frmQueryRoad((_AppHk as Plugin.Application.IAppFormRef).MainForm, _AppHk.MapControl, pRiverFeaClass, strLayerName, strFieldName, strFieldCode, "河 流 名:", "河流编码:", "河流查询"); fmQD.WriteLog = this.WriteLog; fmQD.Show((_AppHk as Plugin.Application.IAppFormRef).MainForm); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { if (m_hookHelper.Hook == null) { return; } //IFeatureLayer tmpFeatureLayer = layerCurSeleted(); //if (tmpFeatureLayer == null) //{ // MessageBox.Show("请在地图目录设置当前选择图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} try { //if (m_hookHelper.FocusMap.SelectionCount > 100) //int ooo = m_hookHelper.FocusMap.SelectionCount; List <IGeometry> vTemp = GetDataGeometry(m_hookHelper.FocusMap); if (vTemp == null) { return; } SysCommon.CProgress pgss = new SysCommon.CProgress("正在加载制图界面,请稍候..."); pgss.EnableCancel = false; pgss.ShowDescription = false; pgss.FakeProgress = true; pgss.TopMost = true; pgss.ShowProgress(); //ITopologicalOperator pTO = GetUnion(vTemp) as ITopologicalOperator; ESRI.ArcGIS.Geometry.IGeometry pGeometry = GetUnion(vTemp); m_hookHelper.FocusMap.ClearSelection(); //m_hookHelper.ActiveView.Extent=pGeometry.Envelope; m_hookHelper.ActiveView.Refresh(); Application.DoEvents(); drawgeometryXOR(pGeometry as IPolygon, m_pScreenDisplay); frm = new FrmPageLayout(m_hookHelper.FocusMap, pGeometry); frm.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 frm.FormClosed += new FormClosedEventHandler(frm_FormClosed); frm.typeZHT = 2; frm.Show(); pgss.Close(); Application.DoEvents(); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); } }
public override void OnClick() { //保存路径 if (ModMxd._MxdPath.Equals("")) { SaveFileDialog Sfd = new SaveFileDialog(); Sfd.Title = "另存为地图文档"; Sfd.Filter = "(*.mxd)|*.mxd"; if (Sfd.ShowDialog() != DialogResult.OK) { return; } ModMxd._MxdPath = Sfd.FileName; } IMxdContents pMxdC; pMxdC = _AppHk.MapControl.Map as IMxdContents; IMapDocument pMapDocument = new MapDocumentClass(); //打开地图文档 if (File.Exists(ModMxd._MxdPath)) { pMapDocument.Open(ModMxd._MxdPath, ""); } else { pMapDocument.New(ModMxd._MxdPath); } //保存信息 IActiveView pActiveView = _AppHk.MapControl.Map as IActiveView; pMapDocument.ReplaceContents(pMxdC); try//yjl20110817 防止保存时,其他程序也在打开这个文档而导致共享冲突从而使系统报错 { pMapDocument.Save(true, true); if (this.WriteLog) { Plugin.LogTable.Writelog("保存地图文档到" + ModMxd._MxdPath); } ErrorHandle.ShowFrmErrorHandle("提示", "保存成功!"); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", "保存失败!请关掉其他正在打开该文档的程序,重新试一次。"); } pMapDocument.Close();//yjl20110817 }
public override void OnClick() { if (_AppHk == null) { return; } if (_AppHk.MapControl == null) { return; } IMap pMap = _AppHk.MapControl.Map; string strFieldName = ""; //名称字段 string strFieldCode = ""; //编码字段 string strRoadName = "铁路查询"; string strLayerName = ""; IFeatureClass pRoadFeaClass = null; try {//获取道路地物类 ModQuery.GetQueryConfig(strRoadName, out pRoadFeaClass, out strLayerName, out strFieldName, out strFieldCode); if (pRoadFeaClass == null) { MessageBox.Show("找不到铁路数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //检查河流名称字段 if (pRoadFeaClass.FindField(strFieldName) < 0) { MessageBox.Show("找不到铁路名称属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); pRoadFeaClass = null; return; } //检查河流编码字段 if (pRoadFeaClass.FindField(strFieldCode) < 0) { MessageBox.Show("找不到铁路编码属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); pRoadFeaClass = null; return; } frmQueryRoad fmQD = new frmQueryRoad(_pAppForm.MainForm, _AppHk.MapControl, pRoadFeaClass, strLayerName, strFieldName, strFieldCode, "铁 路 名:", "铁路编码:", "铁路查询"); fmQD.WriteLog = this.WriteLog; fmQD.Show(_pAppForm.MainForm); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
public override void OnClick() { // zhangqi Add //判断配置文件是否存在 bool blnCanConnect = false; SysCommon.Gis.SysGisDB vgisDb = new SysGisDB(); if (File.Exists(GeoDBIntegration.ModuleData.v_ConfigPath)) { //获得系统维护库连接信息 SysCommon.Authorize.AuthorizeClass.GetConnectInfo(GeoDBIntegration.ModuleData.v_ConfigPath, out GeoDBIntegration.ModuleData.Server, out GeoDBIntegration.ModuleData.Instance, out GeoDBIntegration.ModuleData.Database, out GeoDBIntegration.ModuleData.User, out GeoDBIntegration.ModuleData.Password, out GeoDBIntegration.ModuleData.Version, out GeoDBIntegration.ModuleData.dbType); //连接系统维护库 blnCanConnect = CanOpenConnect(vgisDb, GeoDBIntegration.ModuleData.dbType, GeoDBIntegration.ModuleData.Server, GeoDBIntegration.ModuleData.Instance, GeoDBIntegration.ModuleData.Database, GeoDBIntegration.ModuleData.User, GeoDBIntegration.ModuleData.Password, GeoDBIntegration.ModuleData.Version); } else { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "缺失系统维护库连接信息文件:" + GeoDBIntegration.ModuleData.v_ConfigPath + "/n请重新配置"); return; } if (!blnCanConnect) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "系统能够维护库连接失败,请检查!"); return; } //zhangqi add end GeoDBIntegration.ModuleData.TempWks = vgisDb.WorkSpace; SysCommon.CProgress pgss = new SysCommon.CProgress("正在加载元数据出图界面,请稍候..."); try { pgss.EnableCancel = false; pgss.ShowDescription = false; pgss.FakeProgress = true; pgss.TopMost = false; pgss.ShowProgress(); Application.DoEvents(); createMatadataMap(vgisDb.WorkSpace); pgss.Close(); } catch (Exception ex) { pgss.Close(); ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); return; } frmMetaMap FrmMetaConv = new frmMetaMap(vgisDb.WorkSpace); FrmMetaConv.ShowDialog(); }
public override void OnClick() { if (m_Hook == null) { return; } try { frmOrderTaskQuery vFrm = new frmOrderTaskQuery(m_Hook.MapControl, Plugin.ModuleCommon.TmpWorkSpace); vFrm.ShowDialog(); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); } }
public override void OnClick() { if (m_Hook.UserTree.SelectedNode != null) { Exception eError; User user = m_Hook.UserTree.SelectedNode.Tag as User; if (user == null) { return; } if (m_AppUser == null) { return; } if (user.Name.ToLower() == "admin") { ErrorHandle.ShowFrmErrorHandle("提示", "管理员不能删除!"); return; } if (user.IDStr == m_AppUser.IDStr) { ErrorHandle.ShowFrmErrorHandle("提示", "用户不能删除自己!"); return; } if (ErrorHandle.ShowFrmInformation("确认", "取消", "确认删除?")) { //删除提取范围 ModuleOperator.DeleteData("USER_EXPORT", "userid", user.IDStr, ref ModData.gisDb, out eError); if (ModuleOperator.DeleteData("user_info", "userid", user.IDStr, ref ModData.gisDb, out eError)) { if (this.WriteLog) { Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } m_Hook.UserTree.SelectedNode.Remove(); } else { if (eError != null) { ErrorHandle.ShowInform("提示", eError.Message); return; } } } } }
private void toolSnapToFeature_Click(object sender, EventArgs e) { if (this.m_bSnapToFeature == false) { if (pTool.CacheCount > 2000) { ErrorHandle.ShowFrmErrorHandle("提示", "要素缓存数量超出容限。请缩小量算视图的范围或将不需要的图层关闭。"); return; } this.m_bSnapToFeature = true; } else { this.m_bSnapToFeature = false; } toolSnapToFeature.Checked = m_bSnapToFeature; }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (this.WriteLog) { Plugin.LogTable.Writelog(Caption); } try { frmQuerySet fmQS = new frmQuerySet(m_Hook.ArcGisMapControl.Map, queryType.Within); if (fmQS.ShowDialog() != DialogResult.OK) { return; } frmQuery fmQuery = new frmQuery(m_Hook.MapControl, enumQueryMode.Visiable, false); SysCommon.CProgress pgss = new SysCommon.CProgress("正在查询,请稍候..."); pgss.EnableCancel = false; pgss.ShowDescription = false; pgss.FakeProgress = true; pgss.TopMost = true; pgss.ShowProgress(); Application.DoEvents(); fmQuery.FillData(fmQS.lstQueryedLayer, fmQS.GeometryBag, queryType.Within); pgss.Close(); Application.DoEvents(); if (this.WriteLog) { Plugin.LogTable.Writelog(Caption); } fmQuery.Show(m_frmhook.MainForm); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); } }
private void lookLog(string filename) { try { if (filename == "") { ErrorHandle.ShowFrmErrorHandle("提示", "日志文件不存在!"); } else { Process.Start("notepad.exe", filename); } } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
/// <summary> /// Occurs when this tool is clicked /// </summary> public override void OnClick() { IFeatureSelection curLayerSn = getEditLayer.isExistLayer(m_MapControl.Map) as IFeatureSelection; if (curLayerSn == null) { ErrorHandle.ShowFrmErrorHandle("提示", "请先设置编辑图层。"); return; } ISelectionSet pSS = curLayerSn.SelectionSet; if (pSS.Count != 1) { m_MapControl.CurrentTool = null; ErrorHandle.ShowFrmErrorHandle("提示", "请在编辑图层上选择要移动的要素。"); return; } }
private void btnOK_Click(object sender, EventArgs e) { if (txtResolution.Text == "" || txtFileName.Text == "" || cBoxRatio.Text == "") { return; } try { int r = Convert.ToInt32(txtResolution.Text); int ra = Convert.ToInt32(cBoxRatio.Text); } catch (Exception exError) { ErrorHandle.ShowFrmErrorHandle("提示", exError.Message); return; } isOK = true; this.Close(); }
public override void OnClick() { Exception eError; FrmAddDepartment frmDepartment = new FrmAddDepartment(); if (this.WriteLog) { Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } if (frmDepartment.ShowDialog() == DialogResult.OK) { ModuleOperator.DisplayUserTree("", m_Hook.UserTree, ref ModData.gisDb, out eError); if (eError != null) { ErrorHandle.ShowFrmErrorHandle("提示", eError.Message); return; } } }
//函数功能:修改记录for add //输入参数:无 输出参数:布尔型 private bool ModifyAfterAdd() { if (GeoDataCenterFunLib.LogTable.m_sysTable == null) { return(false); } Exception ex = null; ITable pTable = GeoDataCenterFunLib.LogTable.m_sysTable.OpenTable(m_TableName, out ex); if (pTable == null) { return(false); } string whereClause = pTable.OIDFieldName; Dictionary <string, object> pDic = new Dictionary <string, object>(); for (int i = 0; i < m_gridView.ColumnCount; i++) //从1开始,第一列是ID { if (m_gridView.Columns[i].Name.ToUpper() == "ID") { whereClause += " = " + m_TextBoxX[i].Text; continue; } //if (m_LabelX[i].Text.Contains(":")) //{ // m_LabelX[i].Text = m_LabelX[i].Text.Substring(0, m_LabelX[i].Text.LastIndexOf(":")); //} pDic.Add(m_gridView.Columns[i].Name, m_TextBoxX[i].Text); } Exception ex1 = null; try { return(GeoDataCenterFunLib.LogTable.m_sysTable.UpdateRowByAliasName(m_TableName, whereClause, pDic, out ex1));//更新记录 } catch (Exception err) { ErrorHandle.ShowFrmErrorHandle("提示", "添加记录失败!" + err.Message); return(false); } }
private void buttonX1_Click(object sender, EventArgs e) { openFileDialog1.Filter = "控制点文件|*.txt"; openFileDialog1.FileName = ""; openFileDialog1.Multiselect = false; if (openFileDialog1.ShowDialog() == DialogResult.OK) { txtCtrlPtPath.Text = openFileDialog1.FileName; fillDGView(openFileDialog1.OpenFile()); try { initTransformation(); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } } txtCtrlPtPath.ForeColor = Color.Black; }
private void btnEditCtrlPts_Click(object sender, EventArgs e) { if (btnEditCtrlPts.Text == "编辑") { dgvCtrlPt.ReadOnly = false; btnEditCtrlPts.Text = "保存"; } else { dgvCtrlPt.ReadOnly = true; btnEditCtrlPts.Text = "编辑"; try { initTransformation(); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } } }
private void executeSQL(string sql) { OleDbConnection conn = new OleDbConnection(connStr); conn.Open(); OleDbCommand pCmd = conn.CreateCommand(); pCmd.CommandText = sql; try { pCmd.ExecuteNonQuery(); } catch (Exception ex) { ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } finally { conn.Close(); } }
public override void OnClick() { Exception eError; if (this.WriteLog) { Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志 } frmUserGroupQuery fm = new frmUserGroupQuery(); if (fm.ShowDialog() == DialogResult.OK && fm.GroupName != "") { ModuleOperator.GroupByName = fm.GroupName; ModuleOperator.DisplayUserTree("", m_Hook.UserTree, ref ModData.gisDb, out eError); if (eError != null) { ErrorHandle.ShowFrmErrorHandle("提示", eError.Message); return; } } }