public static bool DelFeature(WebFeature.Feature f, DataRow dr) { try { bool b = true; string strWhere = "项目档案号='" + dr["项目档案号"].ToString() + "'"; //Log.WriteLog("strWhere>>>>" + strWhere); #region 要素存在时,删除 if (f.IsFeatureExistNew("两矿", "subjectType=CK&layerShortName=" + strLayerShortName, strWhere)) { b = f.DelFeatureNew("两矿", "subjectType=CK&layerShortName=" + strLayerShortName, 0, strWhere) && b; } #endregion if (b) { DebugInfo("DelFeatureNew()>>>>" + b.ToString()); } else { DebugInfo("DelFeatureNew()>>>>" + b.ToString()); } return(b); } catch (Exception ex) { return(false); throw ex; } }
public bool DelFeature(string solutionName, string inputAtt, string strWhere) { try { bool b; b = f.DelFeatureNew(solutionName, inputAtt, 0, strWhere); return(b); } catch (Exception ex) { throw ex; } }
public static bool UpdateFeature(WebFeature.Feature f, DataRow dr) { try { bool b = false; if (IsFeatureExitCKSQDJ(f, dr)) { DebugInfo("UpdateFeature()中判断要素已存在,不需要更新!"); return(true); } else { DebugInfo("UpdateFeature()中判断要素不存在,需要更新!"); #region attField string[] attField = { "CK_GUID", "申请序号", "许可证号", "项目档案号", "项目类型", "申请人", "电话", "地址", "邮编", "矿山名称", "经济类型", "项目审批机关", "批准文号", "资金来源", "设计年限", "开采主矿种", "其它主矿种", "设计规模", "规模单位", "开采方式", "采矿方法", "选矿方法", "应缴纳采矿权价款", "采深上限", "采深下限", "矿区面积", "采矿权使用费", "有效期限", "有效期起", "有效期止", "矿区编码", "原许可证号", "发证机关名称", "区域坐标", "设计利用储量", "坐标系统", "签发时间" }; #endregion #region attValue string[] attValue = { dr["CK_GUID"].ToString(), dr["申请序号"].ToString(), dr["许可证号"].ToString(), dr["项目档案号"].ToString(), dr["项目类型"].ToString(), dr["申请人"].ToString(), dr["电话"].ToString(), dr["地址"].ToString(), dr["邮编"].ToString(), dr["矿山名称"].ToString(), dr["经济类型"].ToString(), dr["项目审批机关"].ToString(), dr["批准文号"].ToString(), dr["资金来源"].ToString(), dr["设计年限"].ToString(), dr["开采主矿种"].ToString(), dr["其它主矿种"].ToString(), dr["设计规模"].ToString(), dr["规模单位"].ToString(), dr["开采方式"].ToString(), dr["采矿方法"].ToString(), dr["选矿方法"].ToString(), dr["应缴纳采矿权价款"].ToString(), dr["采深上限"].ToString(), dr["采深下限"].ToString(), dr["矿区面积"].ToString(), dr["采矿权使用费"].ToString(), dr["有效期限"].ToString(), dr["有效期起"].ToString(), dr["有效期止"].ToString(), dr["矿区编码"].ToString(), dr["原许可证号"].ToString(), dr["发证机关名称"].ToString(), dr["区域坐标"].ToString(), dr["设计利用储量"].ToString(), dr["坐标系统"].ToString(), dr["签发时间"].ToString() }; #endregion #region 判断当前『项目档案号』是否存在于图层中 string strWhere = "项目档案号='" + dr["项目档案号"].ToString() + "'"; #region 存在时先删除记录 if (f.IsFeatureExistNew("两矿", "subjectType=CK&layerShortName=" + strLayerShortName, strWhere)) { DebugInfo("同『项目档案号』要素已存在"); try { DebugInfo("调用DelFeature()方法"); #region 除对应记录 b = f.DelFeatureNew("两矿", "subjectType=CK&layerShortName=" + strLayerShortName, 0, strWhere); DebugInfo(b.ToString()); if (!b) { return(b); } #endregion } catch (Exception ex) { throw ex; } } #endregion #endregion #region 插入记录 //Log.WriteLog("AddFeatureNew"); ///尝试插入数据 if (f.AddFeatureNew("两矿", "subjectType=CK&layerShortName=" + strLayerShortName, GetCKFormattedDotString(dr["区域坐标"].ToString(), true), attField, attValue)) { DebugInfo("AddFeature()方法成功"); b = true; } else { DebugInfo("AddFeature()方法失败"); b = false; } #endregion DebugInfo("项目档案号=" + dr["项目档案号"].ToString()); #region UpdateFeature.Debug for (int i = 0; i < attField.Length; i++) { DebugInfo(attField[i].ToString() + ">>>>" + attValue[i].ToString()); } DebugInfo("==========================================================="); //for (int i = 0; i < attValue.Length; i++) // DebugInfo(attValue[i].ToString()); #endregion } return(b); } catch (Exception ex) { errorMsg = "UpdateFeature()方法出错!"; Log.WriteLog(errorMsg + ">>>>" + ex.Message); throw ex; } }