/// <summary> /// 功能描述 : 根据年份、城市代码获得[tblEQID_D_Point]表的测点代码和测点名称 /// 创建者 : 黄成 /// 创建日期 : 2012-02-22 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <param name="STCode">城市代码</param> /// <param name="Year">年份</param> /// <returns>IList</returns> public IList <tblEQID_D_Point> GetPCodeByYear(string STCode, int Year) { try { DataTable tblData = new DataTable(); usp_tblEQID_D_Point_GetGDCODEByYear uspGetPCode = new usp_tblEQID_D_Point_GetGDCODEByYear(); uspGetPCode.fldSTCode = STCode; uspGetPCode.fldYear = Year; tblData = uspGetPCode.ExecDataTable(); if (tblData != null) { IList <tblEQID_D_Point> listAll = new List <tblEQID_D_Point>(); for (int i = 0; i < tblData.Rows.Count; i++) { DataTable tblTmp = tblData.Clone(); tblTmp.Rows.Add(tblData.Rows[i].ItemArray); tblEQID_D_Point objData = new tblEQID_D_Point(); objData.MetaDataTable = tblTmp; listAll.Add(objData); } tblData.Dispose(); return(listAll); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetListException("打开数据库连接失败", "RuletblEQID_D_Point", "GetPCodeByYear", "STCode:" + STCode + ",Year:" + Year.ToString()); } catch (DBQueryException e) { throw new GetListException("执行Sql语句失败", "RuletblEQID_D_Point", "GetPCodeByYear", "STCode:" + STCode + ",Year:" + Year.ToString()); } catch (Exception e) { throw new GetListException(e.Message, "RuletblEQID_D_Point", "GetPCodeByYear", "STCode:" + STCode + ",Year:" + Year.ToString()); } }
/// <summary> /// 功能描述 : 根据当前年份获得[tblEQIA_R_Point]表的记录供GIS使用 /// 创建者 : 朱春华 /// 创建日期 : 2012-03-29 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <returns>List</returns> public List <tblEQID_D_Point> GetPointInfoForGis() { try { DataTable tblData = new DataTable(); usp_tblEQID_D_Point_ForGis uspGetAll = new usp_tblEQID_D_Point_ForGis(); tblData = uspGetAll.ExecDataTable(); if (tblData != null) { List <tblEQID_D_Point> listAll = new List <tblEQID_D_Point>(); for (int i = 0; i < tblData.Rows.Count; i++) { DataTable tblTmp = tblData.Clone(); tblTmp.Rows.Add(tblData.Rows[i].ItemArray); tblEQID_D_Point objData = new tblEQID_D_Point(); objData.MetaDataTable = tblTmp; listAll.Add(objData); } tblData.Dispose(); return(listAll); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetListException("打开数据库连接失败", "RuletblEQID_D_Point", "GetPointInfoForGis", ""); } catch (DBQueryException e) { throw new GetListException("执行Sql语句失败", "RuletblEQID_D_Point", "GetPointInfoForGis", ""); } catch (Exception e) { throw new GetListException(e.Message, "RuletblEQID_D_Point", "GetPointInfoForGis", ""); } }