public static void AddFieldCodeDoaminMap(string string_0, string string_1, string string_2) { if (m_pDomainMapTable == null) { m_pDomainMapTable = AppConfigInfo.OpenTable(CodeDomainMapTableStruct.TableName); if (m_pDomainMapTable == null) { return; } } string[] strArray = string_0.Split(new char[] { '.' }); string_0 = strArray[strArray.Length - 1]; if (CheckHasDamain(string_1, string_0)) { ModifyCodeDoaminMap(string_0, string_1, string_2); } else { IRow row = m_pDomainMapTable.CreateRow(); row.set_Value(m_pDomainMapTable.FindField(CodeDomainMapTableStruct.FeatureClassName), string_0); row.set_Value(m_pDomainMapTable.FindField(CodeDomainMapTableStruct.FieldName), string_1); row.set_Value(m_pDomainMapTable.FindField(CodeDomainMapTableStruct.DomainID), string_2); row.Store(); } }
public static string GetDamainName(string string_0, string string_1) { string str = ""; if (m_pDomainMapTable == null) { m_pDomainMapTable = AppConfigInfo.OpenTable(CodeDomainMapTableStruct.TableName); if (m_pDomainMapTable == null) { return(str); } } string[] strArray = string_1.Split(new char[] { '.' }); string str3 = string.Format("{0}='{1}' and {2}='{3}'", new object[] { CodeDomainMapTableStruct.FieldName, string_0, CodeDomainMapTableStruct.FeatureClassName, strArray[strArray.Length - 1] }); IQueryFilter queryFilter = new QueryFilter { WhereClause = str3 }; ICursor o = m_pDomainMapTable.Search(queryFilter, false); IRow row = o.NextRow(); if (row != null) { str = row.get_Value(m_pDomainMapTable.FindField(CodeDomainMapTableStruct.DomainID)).ToString(); row.Store(); } ComReleaser.ReleaseCOMObject(o); return(str); }
public static void DeleteDomain(string string_0) { if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); if (m_pDomainTable == null) { return; } } IQueryFilter queryFilter = new QueryFilter { WhereClause = string.Format("{0} = '{1}'", CodeDomainTableStruct.DomainIDFieldName, string_0) }; m_pDomainTable.DeleteSearchedRows(queryFilter); if (m_pDomainMapTable == null) { m_pDomainMapTable = AppConfigInfo.OpenTable(CodeDomainMapTableStruct.TableName); if (m_pDomainMapTable == null) { return; } } queryFilter.WhereClause = string.Format("{0} = '{1}'", CodeDomainMapTableStruct.DomainID, string_0); m_pDomainMapTable.DeleteSearchedRows(queryFilter); }
private void CatoTemplateApplySelect_Load(object sender, EventArgs e) { CartoTemplateTableStruct struct2 = new CartoTemplateTableStruct(); ITable table = AppConfigInfo.OpenTable(struct2.TableName); if (table != null) { ICursor o = table.Search(null, false); IRow row = o.NextRow(); string[] items = new string[2]; while (row != null) { CartoTemplateData data = new CartoTemplateData(row); items[0] = data.Name; items[1] = data.Description; ListViewItem item = new ListViewItem(items) { Tag = data }; this.listView1.Items.Add(item); row = o.NextRow(); } ComReleaser.ReleaseCOMObject(o); o = null; } }
public static void ModifyCodeDoaminMap(string string_0, string string_1, string string_2) { if (m_pDomainMapTable == null) { m_pDomainMapTable = AppConfigInfo.OpenTable(CodeDomainMapTableStruct.TableName); if (m_pDomainMapTable == null) { return; } } string[] strArray = string_0.Split(new char[] { '.' }); string_0 = strArray[strArray.Length - 1]; string str = string.Format("{0}='{1}' and {2}='{3}'", new object[] { CodeDomainMapTableStruct.FieldName, string_1, CodeDomainMapTableStruct.FeatureClassName, string_0 }); IQueryFilter queryFilter = new QueryFilter { WhereClause = str }; ICursor o = m_pDomainMapTable.Search(queryFilter, false); IRow row = o.NextRow(); if (row != null) { row.set_Value(m_pDomainMapTable.FindField(CodeDomainMapTableStruct.DomainID), string_2); row.Store(); } ComReleaser.ReleaseCOMObject(o); }
public static bool IsZDFeatureClass(IFeatureClass ifeatureClass_0) { bool result; if (ifeatureClass_0 == null) { result = false; } else { ITable table = null; try { table = AppConfigInfo.OpenTable("ZDInfos"); } catch { } if (table == null) { try { ZDHistoryManage zDHistoryManage = new ZDHistoryManage(); zDHistoryManage.CreateTable(AppConfigInfo.GetWorkspace() as IFeatureWorkspace); table = AppConfigInfo.OpenTable("ZDInfos"); } catch (System.Exception) { } } if (table == null) { result = false; } else { string workspaceConnectInfo = WorkspaceOperator.GetWorkspaceConnectInfo((ifeatureClass_0 as IDataset).Workspace); IQueryFilter queryFilter = new QueryFilter(); string[] array = (ifeatureClass_0 as IDataset).Name.Split(new char[] { '.' }); queryFilter.WhereClause = string.Format("FeatureClassName='{0}' and GDBConnectInfo='{1}'", array[array.Length - 1], workspaceConnectInfo); try { int num = table.RowCount(queryFilter); result = (num == 1); return(result); } catch (System.Exception) { } result = false; } } return(result); }
private void LoadAppConfigs() { try { WebRequest webRequest = new WebRequest(); webRequest.Session = Session; webRequest.Code = (int)S1200Codes.GetAppConfigList; Service12001Client client = new Service12001Client( WebHelper.CreateBasicHttpBinding(Session) , WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service12001")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { WriteLog("LoadAppConfigs", string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { WriteLog("LoadAppConfigs", string.Format("ListData is null")); return; } int count = webReturn.ListData.Count; if (AppConfigs == null) { AppConfigs = new AppConfigs(); } AppConfigs.ListApps.Clear(); OperationReturn optReturn; for (int i = 0; i < count; i++) { string strInfo = webReturn.ListData[i]; optReturn = XMLHelper.DeserializeObject <AppConfigInfo>(strInfo); if (!optReturn.Result) { WriteLog("LoadAppConfigs", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); continue; } AppConfigInfo info = optReturn.Data as AppConfigInfo; if (info == null) { WriteLog("LoadAppConfigs", string.Format("AppConfigInfo is null")); continue; } AppConfigs.ListApps.Add(info); } WriteLog("LoadAppConfigs", string.Format("Load end.\tCount:{0}", count)); } catch (Exception ex) { WriteLog("LoadAppConfigs", string.Format("Fail.\t{0}", ex.Message)); } }
public static bool Register(IFeatureClass ifeatureClass_0, string string_0) { bool result; if (ZDRegister.IsZDFeatureClass(ifeatureClass_0)) { result = false; } else { string[] array = (ifeatureClass_0 as IDataset).Name.Split(new char[] { '.' }); ZDRegisterTable zDRegisterTable = new ZDRegisterTable(); ITable table = AppConfigInfo.OpenTable("ZDInfos"); IFeatureWorkspace featureWorkspace = (ifeatureClass_0 as IDataset).Workspace as IFeatureWorkspace; string finalName = WorkspaceOperator.GetFinalName2(featureWorkspace as IWorkspace, esriDatasetType.esriDTFeatureClass, "", array[array.Length - 1], "_His"); IRow row = table.CreateRow(); RowOperator.SetFieldValue(row, zDRegisterTable.FeatureClassNameField, array[array.Length - 1]); RowOperator.SetFieldValue(row, zDRegisterTable.ZDBHFieldName, string_0); RowOperator.SetFieldValue(row, zDRegisterTable.RegisterDateFieldName, System.DateTime.Now); RowOperator.SetFieldValue(row, zDRegisterTable.HistoryFeatureClassName, finalName); string workspaceConnectInfo = WorkspaceOperator.GetWorkspaceConnectInfo((ifeatureClass_0 as IDataset).Workspace); RowOperator.SetFieldValue(row, zDRegisterTable.GDBConnectInfoName, workspaceConnectInfo); RowOperator.SetFieldValue(row, zDRegisterTable.GuidName, System.Guid.NewGuid().ToString()); row.Store(); (ifeatureClass_0 as IDataset).Name.Split(new char[] { '.' }); IFields fields = (ifeatureClass_0.Fields as IClone).Clone() as IFields; IField field = new ESRI.ArcGIS.Geodatabase.Field(); (field as IFieldEdit).Name_2 = "OriginOID_"; (field as IFieldEdit).AliasName_2 = "原始宗地编号"; (field as IFieldEdit).Type_2 = esriFieldType.esriFieldTypeInteger; (fields as IFieldsEdit).AddField(field); IFeatureClass featureClass = featureWorkspace.CreateFeatureClass(finalName, fields, null, null, esriFeatureType.esriFTSimple, "shape", ""); if ((featureWorkspace as IWorkspace).Type == esriWorkspaceType.esriRemoteDatabaseWorkspace) { IVersionedObject3 versionedObject = featureClass as IVersionedObject3; if (versionedObject != null) { versionedObject.RegisterAsVersioned3(false); } } result = true; } return(result); }
public static bool UpdateZDAttribute(IFeature ifeature_0, string string_0, object object_0, out IFeature ifeature_1) { ZDEditTools.StartEditDateTime = DateTime.Now; Editor.StartEditOperation(); IWorkspace workspace = AppConfigInfo.GetWorkspace(); if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StartEditOperation(); } ifeature_1 = null; bool flag = ZDEditTools.Oids.IndexOf(ifeature_0.OID) == -1; IFeature feature = null; if (flag) { feature = ZDEditTools.WriteHistory(ifeature_0); } bool flag1 = true; try { ifeature_0.Value[ifeature_0.Fields.FindField(string_0)] = object_0; ifeature_0.Store(); if (flag) { IFeature feature1 = ZDEditTools.ZDFeatureClass.CreateFeature(); RowOperator.CopyFeatureToFeature(ifeature_0, feature1); ZDEditTools.Oids.Add(feature1.OID); ifeature_1 = feature1; ZDEditTools.WriteHistoryLine(ifeature_0, feature1, feature, 5, ZDEditTools.StartEditDateTime); ifeature_0.Delete(); } } catch (Exception exception1) { Exception exception = exception1; if (feature != null) { feature.Delete(); } flag1 = false; MessageBox.Show("输入数据格式错误"); // CErrorLog.writeErrorLog(null, exception, ""); } if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StopEditOperation(); } Editor.StopEditOperation(); return(flag1); }
public static bool UpdateZDAttribute(IFeature ifeature_0, string string_0, object object_0, out IFeature ifeature_1) { ZDEditTools.StartEditDateTime = System.DateTime.Now; Editor.Editor.StartEditOperation(); IWorkspace workspace = AppConfigInfo.GetWorkspace(); if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StartEditOperation(); } ifeature_1 = null; bool flag = ZDEditTools.Oids.IndexOf(ifeature_0.OID) == -1; IFeature feature = null; if (flag) { feature = ZDEditTools.WriteHistory(ifeature_0); } bool result = true; try { int index = ifeature_0.Fields.FindField(string_0); ifeature_0.set_Value(index, object_0); ifeature_0.Store(); if (flag) { IFeature feature2 = ZDEditTools.ZDFeatureClass.CreateFeature(); RowOperator.CopyFeatureToFeature(ifeature_0, feature2); ZDEditTools.Oids.Add(feature2.OID); ifeature_1 = feature2; ZDEditTools.WriteHistoryLine(ifeature_0, feature2, feature, 5, ZDEditTools.StartEditDateTime); ifeature_0.Delete(); } } catch (System.Exception exception_) { if (feature != null) { feature.Delete(); } result = false; System.Windows.Forms.MessageBox.Show("输入数据格式错误"); //Logger.Current.Error("", exception_, ""); } if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StopEditOperation(); } Editor.Editor.StopEditOperation(); return(result); }
public static CodeDomainEx AddCodeDomain(string string_0, string string_1, string string_2, string string_3, string string_4, string string_5, string string_6, esriFieldType esriFieldType_0) { if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); if (m_pDomainTable == null) { return(null); } } IQueryFilter queryFilter = new QueryFilter { WhereClause = string.Format("{0} = '{1}'", CodeDomainTableStruct.DomainNameFieldName, string_2) }; if (m_pDomainTable.RowCount(queryFilter) > 0) { MessageBox.Show("存在同名域值定义,请取其他名字!"); return(null); } string str = Guid.NewGuid().ToString(); IRow row = m_pDomainTable.CreateRow(); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ConnectionFieldName), string_0); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.TableFieldName), string_1); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DomainNameFieldName), string_2); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ValueFieldName), string_3); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DescriptionFieldName), string_4); m_pDomainTable.FindField(CodeDomainTableStruct.DomainIDFieldName); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DomainIDFieldName), str); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.fieldtypeFieldName), (short)esriFieldType_0); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.IDFieldName), string_5); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ParentIDFieldName), string_6); row.Store(); CodeDomainEx item = new CodeDomainEx { DomainID = str, Name = string_2, FieldType = esriFieldType_0, ConnectionStr = string_0, CodeFieldName = string_3, IDFieldName = string_5, NameFieldName = string_4, ParentIDFieldName = string_6, TableFieldName = string_1 }; CodeDomainExs.Add(item); return(item); }
public static bool EditDomain(string string_0, string string_1, string string_2, string string_3, string string_4, string string_5, string string_6, string string_7, esriFieldType esriFieldType_0) { if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); if (m_pDomainTable == null) { return(false); } } IQueryFilter queryFilter = new QueryFilter { WhereClause = string.Format("{0} = '{1}' and {2}<>'{3}'", new object[] { CodeDomainTableStruct.DomainNameFieldName, string_3, CodeDomainTableStruct.DomainIDFieldName, string_0 }) }; if (m_pDomainTable.RowCount(queryFilter) > 0) { MessageBox.Show("存在同名域值定义,请取其他名字!"); return(false); } queryFilter.WhereClause = string.Format("{0} = '{1}'", CodeDomainTableStruct.DomainIDFieldName, string_0); ICursor o = m_pDomainTable.Search(queryFilter, false); IRow row = o.NextRow(); if (row != null) { row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ConnectionFieldName), string_1); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.TableFieldName), string_2); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DomainNameFieldName), string_3); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ValueFieldName), string_4); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DescriptionFieldName), string_5); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.fieldtypeFieldName), (short)esriFieldType_0); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.IDFieldName), string_6); row.set_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ParentIDFieldName), string_7); row.Store(); } ComReleaser.ReleaseCOMObject(o); return(true); }
public static void LoadDomain() { if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); } if (m_pDomainTable != null) { ICursor o = m_pDomainTable.Search(null, false); IRow row = o.NextRow(); int index = m_pDomainTable.FindField(CodeDomainTableStruct.DomainNameFieldName); int num2 = m_pDomainTable.FindField(CodeDomainTableStruct.DomainIDFieldName); int num3 = m_pDomainTable.FindField(CodeDomainTableStruct.fieldtypeFieldName); int num4 = m_pDomainTable.FindField(CodeDomainTableStruct.DescriptionFieldName); int num5 = m_pDomainTable.FindField(CodeDomainTableStruct.ValueFieldName); int num6 = m_pDomainTable.FindField(CodeDomainTableStruct.ParentIDFieldName); int num7 = m_pDomainTable.FindField(CodeDomainTableStruct.IDFieldName); int num8 = m_pDomainTable.FindField(CodeDomainTableStruct.TableFieldName); int num9 = m_pDomainTable.FindField(CodeDomainTableStruct.ConnectionFieldName); while (row != null) { string str = row.get_Value(index).ToString(); if (str.Length > 0) { string str2 = row.get_Value(num2).ToString(); esriFieldType type = (esriFieldType)Convert.ToInt32(row.get_Value(num3)); CodeDomainEx item = new CodeDomainEx { DomainID = str2, Name = str, FieldType = type, TableFieldName = row.get_Value(num8).ToString(), CodeFieldName = row.get_Value(num5).ToString(), IDFieldName = row.get_Value(num7).ToString(), ConnectionStr = row.get_Value(num9).ToString(), ParentIDFieldName = row.get_Value(num6).ToString(), NameFieldName = row.get_Value(num4).ToString() }; CodeDomainExs.Add(item); } row = o.NextRow(); } ComReleaser.ReleaseCOMObject(o); } }
public bool Load(out IList ilist_0, out IList ilist_1, out IList ilist_2) { ilist_0 = new ArrayList(); ilist_1 = new ArrayList(); ilist_2 = new ArrayList(); new List <Staff>(); ITable table = AppConfigInfo.OpenTable(this.string_0); ICursor o = table.Search(null, false); for (IRow row = o.NextRow(); row != null; row = o.NextRow()) { ilist_0.Add(row.get_Value(table.FindField("ID")).ToString()); ilist_1.Add(row.get_Value(table.FindField("NAME")).ToString()); ilist_2.Add(row.get_Value(table.FindField("PASSWORD_")).ToString()); } ComReleaser.ReleaseCOMObject(o); return(true); }
public static void DeletedSelectedZD(IMap imap_0, IFeatureLayer ifeatureLayer_0) { Editor.StartEditOperation(); IWorkspace workspace = AppConfigInfo.GetWorkspace(); if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StartEditOperation(); } ZDEditTools.DeletedSelectedZD(ifeatureLayer_0 as IFeatureSelection); if (!WorkspaceOperator.WorkspaceIsSame(workspace, Editor.EditWorkspace as IWorkspace)) { (workspace as IWorkspaceEdit).StopEditOperation(); } Editor.StopEditOperation(); imap_0.ClearSelection(); (imap_0 as IActiveView).Refresh(); }
public static bool GetDomainInfo(string string_0, out string string_1, out string string_2, out string string_3, out string string_4, out string string_5, out string string_6, out string string_7, out esriFieldType esriFieldType_0) { string_1 = ""; string_2 = ""; string_3 = ""; string_4 = ""; string_5 = ""; string_6 = ""; string_7 = ""; esriFieldType_0 = esriFieldType.esriFieldTypeString; if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); if (m_pDomainTable == null) { return(false); } } IQueryFilter queryFilter = new QueryFilter { WhereClause = string.Format("{0} = '{1}'", CodeDomainTableStruct.DomainIDFieldName, string_0) }; ICursor o = m_pDomainTable.Search(queryFilter, false); IRow row = o.NextRow(); if (row != null) { string_1 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ConnectionFieldName)).ToString(); string_2 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.TableFieldName)).ToString(); string_3 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DomainNameFieldName)).ToString(); string_4 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ValueFieldName)).ToString(); string_5 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.DescriptionFieldName)).ToString(); string_6 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.IDFieldName)).ToString(); string_7 = row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.ParentIDFieldName)).ToString(); esriFieldType_0 = (esriFieldType) Convert.ToInt32(row.get_Value(m_pDomainTable.FindField(CodeDomainTableStruct.fieldtypeFieldName))); } ComReleaser.ReleaseCOMObject(o); return(true); }
public bool ValidePassword(string string_1, string string_2) { ITable table = AppConfigInfo.OpenTable(this.string_0); if (table == null) { return(false); } IQueryFilter queryFilter = new QueryFilter { WhereClause = "ID='" + string_1 + "' and PASSWORD_ = '" + string_2 + "'" }; if (table.RowCount(queryFilter) == 0) { return(false); } return(true); }
public bool CanUndo(IFeatureClass ifeatureClass_0) { string text = (ifeatureClass_0 as IDataset).Name; string[] array = text.Split(new char[] { '.' }); text = array[array.Length - 1]; if (text.Length > 4) { string a = text.Substring(text.Length - 4).ToLower(); if (a == "_his") { text = text.Substring(0, text.Length - 4); } } string registerZDGuid = ZDRegister.GetRegisterZDGuid(ifeatureClass_0); bool result; if (this.ChageType == ZDEditType.Delete) { result = true; } else { ZDHistoryTable zDHistoryTable = new ZDHistoryTable(); string whereClause = string.Format("{0}='{1}' and {2} in ({3})", new object[] { zDHistoryTable.ZDRegisterGuidName, registerZDGuid, zDHistoryTable.OrigineZDOIDName, this.NewOIDs }); IQueryFilter queryFilter = new QueryFilter(); queryFilter.WhereClause = whereClause; IWorkspace workspace = AppConfigInfo.GetWorkspace(); ITable table = (workspace as IFeatureWorkspace).OpenTable(zDHistoryTable.TableName); int num = table.RowCount(queryFilter); result = (num == 0); } return(result); }
public static NameValueCollection GetCodeDomain(string string_0, NameValueCollection nameValueCollection_0) { if (m_pDomainTable == null) { m_pDomainTable = AppConfigInfo.OpenTable(CodeDomainTableStruct.TableName); } if (m_pDomainTable != null) { string str = string.Format("{0}='{1}'", CodeDomainTableStruct.DomainIDFieldName, string_0); IQueryFilter queryFilter = new QueryFilter { WhereClause = str }; ICursor o = m_pDomainTable.Search(queryFilter, false); IRow row = o.NextRow(); int index = m_pDomainTable.FindField(CodeDomainTableStruct.ConnectionFieldName); int num2 = m_pDomainTable.FindField(CodeDomainTableStruct.TableFieldName); int num3 = m_pDomainTable.FindField(CodeDomainTableStruct.DescriptionFieldName); int num4 = m_pDomainTable.FindField(CodeDomainTableStruct.ValueFieldName); if (row != null) { string str2 = row.get_Value(num2).ToString(); string str3 = row.get_Value(index).ToString(); string str4 = row.get_Value(num3).ToString(); string str5 = row.get_Value(num4).ToString(); DataAccessLayerBaseClass dataAccessLayer = DataAccessLayerFactory.GetDataAccessLayer(DataProviderType.OleDb, str3); string str6 = string.Format("select {0},{1} from {2}", str4, str5, str2); dataAccessLayer.Open(); DataTable table = dataAccessLayer.ExecuteDataTable(str6); for (int i = 0; i < table.Rows.Count; i++) { string name = table.Rows[i][str4].ToString().Trim(); string str8 = table.Rows[i][str5].ToString().Trim(); nameValueCollection_0.Add(name, str8); } } ComReleaser.ReleaseCOMObject(o); } return(nameValueCollection_0); }
private void method_0(int int_0, IPageLayout ipageLayout_0) { ElementsTableStruct struct2 = new ElementsTableStruct(); ITable table = AppConfigInfo.OpenTable(struct2.TableName); IQueryFilter queryFilter = new QueryFilterClass { WhereClause = struct2.TemplateIDFieldName + "=" + int_0.ToString() }; ICursor o = table.Search(queryFilter, false); for (IRow row = o.NextRow(); row != null; row = o.NextRow()) { IElement element = this.method_3(row, ipageLayout_0); if (element != null) { (this._hookHelper.PageLayout as IGraphicsContainer).AddElement(element, -1); } } ComReleaser.ReleaseCOMObject(o); o = null; }
public List <Staff> Load() { List <Staff> list = new List <Staff>(); ITable table = AppConfigInfo.OpenTable(this.string_0); if (table != null) { ICursor o = table.Search(null, false); for (IRow row = o.NextRow(); row != null; row = o.NextRow()) { Staff item = new Staff { StaffID = Convert.ToString(row.get_Value(table.FindField("ID"))), LoginName = Convert.ToString(row.get_Value(table.FindField("NAME"))), RealName = Convert.ToString(row.get_Value(table.FindField("REALNAME"))), Password = Convert.ToString(row.get_Value(table.FindField("PASSWORD_"))) }; list.Add(item); } ComReleaser.ReleaseCOMObject(o); } return(list); }
public static bool CheckHasDamain(string string_0, string string_1) { if (m_pDomainMapTable == null) { m_pDomainMapTable = AppConfigInfo.OpenTable(CodeDomainMapTableStruct.TableName); if (m_pDomainMapTable == null) { return(false); } } string[] strArray = string_1.Split(new char[] { '.' }); string str = string.Format("({0}='{1}' and {2}='{3}') or ({0}='{1}' and {2}='')", new object[] { CodeDomainMapTableStruct.FieldName, string_0, CodeDomainMapTableStruct.FeatureClassName, strArray[strArray.Length - 1] }); IQueryFilter queryFilter = new QueryFilter { WhereClause = str }; return(m_pDomainMapTable.RowCount(queryFilter) > 0); }
public static bool UnRegister(IFeatureClass ifeatureClass_0) { new ZDRegisterTable(); ITable table = AppConfigInfo.OpenTable("ZDInfos"); bool result; if (table == null) { result = false; } else { IQueryFilter queryFilter = new QueryFilter(); string[] array = (ifeatureClass_0 as IDataset).Name.Split(new char[] { '.' }); string workspaceConnectInfo = WorkspaceOperator.GetWorkspaceConnectInfo((ifeatureClass_0 as IDataset).Workspace); queryFilter.WhereClause = string.Format("FeatureClassName='{0}' and GDBConnectInfo='{1}'", array[array.Length - 1], workspaceConnectInfo); string arg = ""; string name = ""; using (ComReleaser comReleaser = new ComReleaser()) { ICursor cursor = table.Search(queryFilter, false); comReleaser.ManageLifetime(cursor); IRow row = cursor.NextRow(); if (row != null) { int num = table.FindField("HistoryFeatureClass"); if (num != -1) { name = row.get_Value(num).ToString(); } num = table.FindField("Guid"); if (num != -1) { arg = row.get_Value(num).ToString(); } row.Delete(); } } table = AppConfigInfo.OpenTable("ZDHistory"); queryFilter = new QueryFilter(); queryFilter.WhereClause = string.Format("ZDRegisterGuid='{0}'", arg); IWorkspaceEdit workspaceEdit = AppConfigInfo.GetWorkspace() as IWorkspaceEdit; bool flag = false; if (!workspaceEdit.IsBeingEdited()) { flag = true; workspaceEdit.StartEditing(true); } workspaceEdit.StartEditOperation(); table.DeleteSearchedRows(queryFilter); workspaceEdit.StopEditOperation(); workspaceEdit.StopEditing(true); if (!flag) { workspaceEdit.StartEditing(true); } try { IFeatureWorkspace featureWorkspace = (ifeatureClass_0 as IDataset).Workspace as IFeatureWorkspace; IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(name); (featureClass as IDataset).Delete(); } catch (System.Exception) { } result = true; } return(result); }
public static string GetHistoryZDFeatureName(IFeatureClass ifeatureClass_0) { string result; if (ifeatureClass_0 == null) { result = ""; } else { ITable table = null; try { table = AppConfigInfo.OpenTable("ZDInfos"); } catch { } if (table == null) { try { ZDHistoryManage zDHistoryManage = new ZDHistoryManage(); zDHistoryManage.CreateTable(AppConfigInfo.GetWorkspace() as IFeatureWorkspace); table = AppConfigInfo.OpenTable("ZDInfos"); } catch (System.Exception) { } } if (table == null) { result = ""; } else { string workspaceConnectInfo = WorkspaceOperator.GetWorkspaceConnectInfo((ifeatureClass_0 as IDataset).Workspace); IQueryFilter queryFilter = new QueryFilter(); string[] array = (ifeatureClass_0 as IDataset).Name.Split(new char[] { '.' }); queryFilter.WhereClause = string.Format("FeatureClassName='{0}' and GDBConnectInfo='{1}'", array[array.Length - 1], workspaceConnectInfo); using (ComReleaser comReleaser = new ComReleaser()) { ICursor cursor = table.Search(queryFilter, false); comReleaser.ManageLifetime(cursor); IRow row = cursor.NextRow(); if (row != null) { int num = table.FindField("HistoryFeatureClass"); string text = ""; if (num != -1) { text = row.get_Value(num).ToString(); } result = text; return(result); } } result = ""; } } return(result); }
public static System.Collections.Generic.List <ZDChangeHistoryInfo2> GetZDChangeHistory( IFeatureClass ifeatureClass_0) { System.Collections.Generic.List <ZDChangeHistoryInfo2> list = new System.Collections.Generic.List <ZDChangeHistoryInfo2>(); ZDHistoryTable zDHistoryTable = new ZDHistoryTable(); string text = (ifeatureClass_0 as IDataset).Name; string[] array = text.Split(new char[] { '.' }); text = array[array.Length - 1]; if (text.Length > 4) { string a = text.Substring(text.Length - 4).ToLower(); if (a == "_his") { text = text.Substring(0, text.Length - 4); } } string registerZDGuid = ZDRegister.GetRegisterZDGuid(ifeatureClass_0); string whereClause = string.Format("{0}='{1}' ", zDHistoryTable.ZDRegisterGuidName, registerZDGuid); IQueryFilter queryFilter = new QueryFilter(); queryFilter.WhereClause = whereClause; (queryFilter as IQueryFilterDefinition).PostfixClause = string.Format(" ORDER BY {0} desc ", zDHistoryTable.ChageDateFieldName); try { using (ComReleaser comReleaser = new ComReleaser()) { IWorkspace workspace = AppConfigInfo.GetWorkspace(); ITable table = (workspace as IFeatureWorkspace).OpenTable(zDHistoryTable.TableName); ICursor cursor = table.Search(queryFilter, true); comReleaser.ManageLifetime(cursor); IRow row = cursor.NextRow(); SortedList <int, ZDChangeHistoryInfo2> sortedList = new SortedList <int, ZDChangeHistoryInfo2>(); SortedList <int, ZDChangeHistoryInfo2> sortedList2 = new SortedList <int, ZDChangeHistoryInfo2>(); while (row != null) { try { object fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.ChangeTypeFieldName); ZDEditType zDEditType = (ZDEditType)System.Convert.ToInt32(fieldValue); fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.ChageDateFieldName); System.DateTime changeDate = System.Convert.ToDateTime(fieldValue); fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.OrigineZDOIDName); int num = System.Convert.ToInt32(fieldValue); fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.NewZDOIDName); int num2 = System.Convert.ToInt32(fieldValue); fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.HisZDOIDName); int num3 = System.Convert.ToInt32(fieldValue); if (num2 != -1) { ZDChangeHistoryInfo2 zDChangeHistoryInfo; if (zDEditType == ZDEditType.Split) { if (sortedList2.ContainsKey(num)) { zDChangeHistoryInfo = sortedList2[num]; } else { zDChangeHistoryInfo = new ZDChangeHistoryInfo2(); sortedList2.Add(num, zDChangeHistoryInfo); zDChangeHistoryInfo.Add(num); zDChangeHistoryInfo.AddHis(num3); zDChangeHistoryInfo.ChangeDate = changeDate; zDChangeHistoryInfo.ChageType = zDEditType; list.Add(zDChangeHistoryInfo); } zDChangeHistoryInfo.AddNew(num2); } else if (zDEditType == ZDEditType.Union) { if (sortedList.ContainsKey(num2)) { zDChangeHistoryInfo = sortedList[num2]; } else { zDChangeHistoryInfo = new ZDChangeHistoryInfo2(); sortedList.Add(num2, zDChangeHistoryInfo); zDChangeHistoryInfo.AddNew(num2); zDChangeHistoryInfo.ChangeDate = changeDate; zDChangeHistoryInfo.ChageType = zDEditType; list.Add(zDChangeHistoryInfo); } zDChangeHistoryInfo.Add(num); zDChangeHistoryInfo.AddHis(num3); } else { zDChangeHistoryInfo = new ZDChangeHistoryInfo2(); zDChangeHistoryInfo.Add(num); zDChangeHistoryInfo.AddNew(num2); zDChangeHistoryInfo.AddHis(num3); zDChangeHistoryInfo.ChangeDate = changeDate; zDChangeHistoryInfo.ChageType = zDEditType; list.Add(zDChangeHistoryInfo); } zDChangeHistoryInfo.HisOID = num3; } else if (num != -1 && zDEditType == ZDEditType.Delete) { ZDChangeHistoryInfo2 zDChangeHistoryInfo = new ZDChangeHistoryInfo2(); zDChangeHistoryInfo.Add(num); zDChangeHistoryInfo.AddNew(num2); zDChangeHistoryInfo.AddHis(num3); zDChangeHistoryInfo.ChangeDate = changeDate; zDChangeHistoryInfo.ChageType = zDEditType; list.Add(zDChangeHistoryInfo); } } catch (System.Exception) { } row = cursor.NextRow(); } } } catch (System.Exception) { } return(list); }
public bool UnDoChange(IFeatureClass ifeatureClass_0) { bool result; if (this.CanUndo(ifeatureClass_0)) { string text = (ifeatureClass_0 as IDataset).Name; string[] array = text.Split(new char[] { '.' }); text = array[array.Length - 1]; if (text.Length > 4) { string a = text.Substring(text.Length - 4).ToLower(); if (a == "_his") { text = text.Substring(0, text.Length - 4); } } string registerZDGuid = ZDRegister.GetRegisterZDGuid(ifeatureClass_0); ZDHistoryTable zDHistoryTable = new ZDHistoryTable(); string whereClause; if (this.ChageType == ZDEditType.Create) { whereClause = string.Format("{0}='{1}' and {2} in ({3})", new object[] { zDHistoryTable.ZDRegisterGuidName, registerZDGuid, zDHistoryTable.NewZDOIDName, this.NewOIDs }); } else { whereClause = string.Format("{0}='{1}' and {2} in ({3})", new object[] { zDHistoryTable.ZDRegisterGuidName, registerZDGuid, zDHistoryTable.OrigineZDOIDName, this.OriginOIDs }); } IQueryFilter queryFilter = new QueryFilter(); queryFilter.WhereClause = whereClause; IWorkspace workspace = AppConfigInfo.GetWorkspace(); ITable table = (workspace as IFeatureWorkspace).OpenTable(zDHistoryTable.TableName); table.DeleteSearchedRows(queryFilter); string historyZDFeatureName = ZDRegister.GetHistoryZDFeatureName(ifeatureClass_0); IFeatureClass featureClass = ((ifeatureClass_0 as IDataset).Workspace as IFeatureWorkspace).OpenFeatureClass(historyZDFeatureName); string[] array2 = this.HisOIDs.Split(new char[] { ',' }); try { if (this.ChageType != ZDEditType.Delete) { queryFilter = new QueryFilter(); whereClause = string.Format("{0} in ({1}) ", ifeatureClass_0.OIDFieldName, this.NewOIDs); queryFilter.WhereClause = whereClause; (ifeatureClass_0 as ITable).DeleteSearchedRows(queryFilter); } } catch (System.Exception) { } int index = featureClass.FindField("OriginOID_"); int index2 = table.FindField(zDHistoryTable.NewZDOIDName); string[] array3 = array2; for (int i = 0; i < array3.Length; i++) { string text2 = array3[i]; if (text2 != "-1") { IFeature feature = ifeatureClass_0.CreateFeature(); IFeature feature2 = featureClass.GetFeature(System.Convert.ToInt32(text2)); int num = System.Convert.ToInt32(feature2.get_Value(index)); RowOperator.CopyFeatureToFeatureEx(feature2, feature); feature2.Delete(); whereClause = string.Format("{0}='{1}' and {2} ={3}", new object[] { zDHistoryTable.ZDRegisterGuidName, registerZDGuid, zDHistoryTable.NewZDOIDName, num }); queryFilter.WhereClause = whereClause; ICursor cursor = table.Search(queryFilter, false); for (IRow row = cursor.NextRow(); row != null; row = cursor.NextRow()) { row.set_Value(index2, feature.OID); row.Store(); } ComReleaser.ReleaseCOMObject(cursor); } } result = true; } else { result = false; } return(result); }
public void LoadParent() { this.IsLoad = true; try { ZDHistoryTable zDHistoryTable = new ZDHistoryTable(); string text = (this.Feature.Class as IDataset).Name; string[] array = text.Split(new char[] { '.' }); text = array[array.Length - 1]; if (text.Length > 4) { string a = text.Substring(text.Length - 4).ToLower(); if (a == "_his") { text = text.Substring(0, text.Length - 4); } } string historyZDFeatureName = ZDRegister.GetHistoryZDFeatureName(this.Feature.Class as IFeatureClass); string registerZDGuid = ZDRegister.GetRegisterZDGuid(this.Feature.Class as IFeatureClass); IFeatureClass ifeatureClass_ = ((this.Feature.Class as IDataset).Workspace as IFeatureWorkspace).OpenFeatureClass( historyZDFeatureName); string whereClause = string.Format("{0}='{1}' and {2}={3}", new object[] { zDHistoryTable.ZDRegisterGuidName, registerZDGuid, zDHistoryTable.NewZDOIDName, this.OID }); IQueryFilter queryFilter = new QueryFilter(); queryFilter.WhereClause = whereClause; IWorkspace workspace = AppConfigInfo.GetWorkspace(); ITable table = (workspace as IFeatureWorkspace).OpenTable(zDHistoryTable.TableName); ICursor cursor = table.Search(queryFilter, false); for (IRow row = cursor.NextRow(); row != null; row = cursor.NextRow()) { ZDChangeHistoryInfo zDChangeHistoryInfo = new ZDChangeHistoryInfo(); object fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.ChangeTypeFieldName); if (this.ChageType == ZDEditType.Unknown) { this.ChageType = (ZDEditType)System.Convert.ToInt32(fieldValue); } fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.ChageDateFieldName); this.ChangeDate = System.Convert.ToDateTime(fieldValue); fieldValue = RowOperator.GetFieldValue(row, zDHistoryTable.OrigineZDOIDName); int oID = System.Convert.ToInt32(fieldValue); zDChangeHistoryInfo.Feature = ZDChangeHistory.GetHisFeat(ifeatureClass_, oID); zDChangeHistoryInfo.OID = oID; zDChangeHistoryInfo.TopFeat = this.Feature; zDChangeHistoryInfo.SouceInfos = new System.Collections.Generic.List <ZDChangeHistoryInfo>(); this.SouceInfos.Add(zDChangeHistoryInfo); } ComReleaser.ReleaseCOMObject(cursor); } catch (System.Exception) { } }