Exemplo n.º 1
0
        public static CustomList <Group> doSearch(string whereClause)
        {
            ConnectionManager  conManager      = new ConnectionManager(ConnectionName.SysMan);
            CustomList <Group> GroupCollection = new CustomList <Group>();
            String             sql             = string.Format("Select * From [Group] Where 1=1 {0}", whereClause);
            IDataReader        reader          = null;;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Group newGroup = new Group();
                    newGroup.SetData(reader);
                    GroupCollection.Add(newGroup);
                }
                reader.Close();
                GroupCollection.SelectSpName = "spSelectGroup";
                GroupCollection.InsertSpName = "spInsertGroup";
                GroupCollection.UpdateSpName = "spUpdateGroup";
                GroupCollection.SelectSpName = "spDeleteGroup";
                return(GroupCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
 public static CustomList<Group> doSearch(string whereClause)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<Group> GroupCollection = new CustomList<Group>();
     String sql = string.Format("Select * From [Group] Where 1=1 {0}", whereClause);
     IDataReader reader = null; ;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Group newGroup = new Group();
             newGroup.SetData(reader);
             GroupCollection.Add(newGroup);
         }
         reader.Close();
         GroupCollection.SelectSpName = "spSelectGroup";
         GroupCollection.InsertSpName = "spInsertGroup";
         GroupCollection.UpdateSpName = "spUpdateGroup";
         GroupCollection.SelectSpName = "spDeleteGroup";
         return GroupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }