Beispiel #1
0
        public static SiteMaster GetCurrentSite()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            IDataReader       reader     = null;
            const String      sql        = "Select * From SiteMaster Where IsCurrent = 1";

            try
            {
                SiteMaster newSiteMaster = new SiteMaster();
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    newSiteMaster.SetData(reader);
                }
                return(newSiteMaster);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Beispiel #2
0
        public static CustomList <SiteMaster> GetAllSiteMaster()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.SysMan);
            CustomList <SiteMaster> SiteMasterCollection = new CustomList <SiteMaster>();
            IDataReader             reader = null;
            const String            sql    = "Select * From SiteMaster Where IsCurrent = 1";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SiteMaster newSiteMaster = new SiteMaster();
                    newSiteMaster.SetData(reader);
                    SiteMasterCollection.Add(newSiteMaster);
                }
                SiteMasterCollection.InsertSpName = "spInsertSiteMaster";
                SiteMasterCollection.UpdateSpName = "spUpdateSiteMaster";
                SiteMasterCollection.DeleteSpName = "spDeleteSiteMaster";
                return(SiteMasterCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Beispiel #3
0
 public static SiteMaster GetCurrentSite()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     IDataReader reader = null;
     const String sql = "Select * From SiteMaster Where IsCurrent = 1";
     try
     {
         SiteMaster newSiteMaster = new SiteMaster();
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             newSiteMaster.SetData(reader);
         }
         return newSiteMaster;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Beispiel #4
0
 public static CustomList<SiteMaster> GetAllSiteMaster()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<SiteMaster> SiteMasterCollection = new CustomList<SiteMaster>();
     IDataReader reader = null;
     const String sql = "Select * From SiteMaster Where IsCurrent = 1";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             SiteMaster newSiteMaster = new SiteMaster();
             newSiteMaster.SetData(reader);
             SiteMasterCollection.Add(newSiteMaster);
         }
         SiteMasterCollection.InsertSpName = "spInsertSiteMaster";
         SiteMasterCollection.UpdateSpName = "spUpdateSiteMaster";
         SiteMasterCollection.DeleteSpName = "spDeleteSiteMaster";
         return SiteMasterCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }