/// <summary> /// 功能描述 : 获得[tblFW_User]表的所有记录 /// 创建者 : Auto Generator /// 创建日期 : 2009-03-27 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <returns>DataTable</returns> public DataTable GetAllData() { try { DataTable tblData = new DataTable(); usp_tblFW_User_ByAll uspByAll = new usp_tblFW_User_ByAll(); tblData = uspByAll.ExecDataTable(1); if (tblData != null) { tblData.TableName = "tblFW_User"; return(tblData); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetAllException("打开数据库连接失败", "RuletblFW_User", "GetAllData", ""); } catch (DBQueryException e) { throw new GetAllException("执行Sql语句失败", "RuletblFW_User", "GetAllData", ""); } catch (Exception e) { throw new GetAllException(e.Message, "RuletblFW_User", "GetAllData", ""); } }
/// <summary> /// 功能描述 : 获得[tblFW_User]表的所有记录 /// 创建者 : Auto Generator /// 创建日期 : 2009-03-27 /// 修改者 : /// 修改日期 : /// 修改原因 : /// </summary> /// <returns>IList<tblFW_User></returns> public IList <tblFW_User> GetAllList() { try { DataTable tblData = new DataTable(); usp_tblFW_User_ByAll uspByAll = new usp_tblFW_User_ByAll(); tblData = uspByAll.ExecDataTable(); if (tblData != null) { IList <tblFW_User> listAll = new List <tblFW_User>(); for (int i = 0; i < tblData.Rows.Count; i++) { DataTable tblTmp = tblData.Clone(); tblTmp.Rows.Add(tblData.Rows[i].ItemArray); tblFW_User objData = new tblFW_User(); objData.MetaDataTable = tblTmp; listAll.Add(objData); } return(listAll); } else { throw new Exception("取得记录失败,未找到对应的记录"); } } catch (DBOpenException e) { throw new GetListException("打开数据库连接失败", "RuletblFW_User", "GetAllList", ""); } catch (DBQueryException e) { throw new GetListException("执行Sql语句失败", "RuletblFW_User", "GetAllList", ""); } catch (Exception e) { throw new GetListException(e.Message, "RuletblFW_User", "GetAllList", ""); } }