/// <summary> /// 功能描述 : 根据断面级别、城市代码和河流代码获得[tblEQIW_R_Section]表的地表水断面名称和断面代码 /// 创建者 : 张浩 /// 创建日期 : 2011-12-28 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <param name="STCode">城市代码</param> /// <param name="RCode">河流代码</param> /// <param name="Level">断面级别</param> /// <param name="include">是否包含上级</param> /// <returns>IList</returns> public IList <tblEQIW_R_Section> GetRSCode(string STCode, string RCode, short Level, int include, int year, int roleid) { try { DataTable tblData = new DataTable(); usp_tblEQIW_R_Section_GetRSCodeByRole uspGetRSCode = new usp_tblEQIW_R_Section_GetRSCodeByRole(); uspGetRSCode.fldSTCode = STCode; uspGetRSCode.fldRCode = RCode; uspGetRSCode.fldSLevel = Level; uspGetRSCode.include = include; uspGetRSCode.fldYear = year; uspGetRSCode.roleid = roleid; tblData = uspGetRSCode.ExecDataTable(); if (tblData != null) { IList <tblEQIW_R_Section> listAll = new List <tblEQIW_R_Section>(); for (int i = 0; i < tblData.Rows.Count; i++) { DataTable tblTmp = tblData.Clone(); tblTmp.Rows.Add(tblData.Rows[i].ItemArray); tblEQIW_R_Section objData = new tblEQIW_R_Section(); objData.MetaDataTable = tblTmp; listAll.Add(objData); } tblData.Dispose(); return(listAll); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetListException("打开数据库连接失败", "RuletblEQIW_R_Section", "GetRSCode", "STCode:" + STCode + ",RCode:" + RCode + ",Level:" + Level.ToString() + ",include:" + include.ToString()); } catch (DBQueryException e) { throw new GetListException("执行Sql语句失败", "RuletblEQIW_R_Section", "GetRSCode", "STCode:" + STCode + ",RCode:" + RCode + ",Level:" + Level.ToString() + ",include:" + include.ToString()); } catch (Exception e) { throw new GetListException(e.Message, "RuletblEQIW_R_Section", "GetRSCode", "STCode:" + STCode + ",RCode:" + RCode + ",Level:" + Level.ToString() + ",include:" + include.ToString()); } }
/// <summary> /// 功能描述 : 根据所选城市代码和河流代码取得[tblEQIW_R_Section]表的地表水交界断面代码 /// 创建者 : Auto Generator /// 创建日期 : 2009-12-28 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <param name="stcode">城市代码</param> /// <param name="rcode">河流代码</param> /// <returns>tblEQIW_R_Section</returns> public IList <tblEQIW_R_Section> GetRSCodeByRCode(string stcode, string rcode, int year) { try { DataTable tblData = new DataTable(); usp_tblEQIW_R_Section_GetRSCodeByRCode uspGetRSCode = new usp_tblEQIW_R_Section_GetRSCodeByRCode(); uspGetRSCode.fldSTCode = stcode; uspGetRSCode.fldRCode = rcode; uspGetRSCode.fldYear = year; tblData = uspGetRSCode.ExecDataTable(); if (tblData != null) { IList <tblEQIW_R_Section> listAll = new List <tblEQIW_R_Section>(); for (int i = 0; i < tblData.Rows.Count; i++) { DataTable tblTmp = tblData.Clone(); tblTmp.Rows.Add(tblData.Rows[i].ItemArray); tblEQIW_R_Section objData = new tblEQIW_R_Section(); objData.MetaDataTable = tblTmp; listAll.Add(objData); } tblData.Dispose(); return(listAll); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetByPKException("打开数据库连接失败", "RuletblEQIW_R_Section", "GetRSCodeByRCode", "stcode:" + stcode + ";rcode:" + rcode); } catch (DBQueryException e) { throw new GetByPKException("执行Sql语句失败", "RuletblEQIW_R_Section", "GetRSCodeByRCode", "stcode:" + stcode + ";rcode:" + rcode); } catch (Exception e) { throw new GetByPKException(e.Message, "RuletblEQIW_R_Section", "GetRSCodeByRCode", "stcode:" + stcode + ";rcode:" + rcode); } }