예제 #1
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name. 
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id!=null) {
         var rec = ActiveRecordLoader.LoadID<FAQItem>(id, "FAQItem", Otherwise.Null);
         if (rec!=null) {
             return rec.GetName();
         }
     }
     return null;
 }
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <AutocompletePhrase>(id, "AutocompletePhrase", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #3
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <ClientContactUsPerson>(id, "ClientContactUsPerson", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #4
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <GenTestHasCat>(id, "GenTestHasCat", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #5
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <ArticleDocument>(id, "ArticleDocument", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #6
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <GalleryCategory>(id, "GalleryCategory", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #7
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <HomepageSlide>(id, "HomepageSlide", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #8
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <MapRegion>(id, "MapRegion", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #9
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <Testimonial>(id, "Testimonial", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #10
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <ShoppingCart>(id, "ShoppingCart", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #11
0
 /// <summary>
 /// This is a quick way of loading a record by ID and returning its title/name.
 /// You can pass it a string, int or any type that the primary key is.
 /// You can override GetNameField() if you want to change which field is defined as the title/name, or override GetName() to completely customise what is returned as the name or title.
 /// </summary>
 /// <returns>The name/title of the item with the given ID</returns>
 public static string FetchName(object id)
 {
     if (id != null)
     {
         var rec = ActiveRecordLoader.LoadID <CompanyDetail>(id, "CompanyDetail", Otherwise.Null);
         if (rec != null)
         {
             return(rec.GetName());
         }
     }
     return(null);
 }
예제 #12
0
        /// <summary>
        /// Loads a record from the GalleryCategory table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg GalleryCategory.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = GalleryCategory.LoadID(55);</example>
        /// <param name="id">Primary key of GalleryCategory</param>
        /// <returns>An instance of GalleryCategory containing the data in the record</returns>
        public static GalleryCategory LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			GalleryCategory record = null;
//			record = GalleryCategory.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where GalleryCategoryID=", Sql.Sqlize(id));
//				record = new GalleryCategory();
//				if (!record.LoadData(sql)) return otherwise.Execute<GalleryCategory>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <GalleryCategory>(id, "GalleryCategory", otherwise));
        }
예제 #13
0
        /// <summary>
        /// Loads a record from the MapRegion table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg MapRegion.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = MapRegion.LoadID(55);</example>
        /// <param name="id">Primary key of MapRegion</param>
        /// <returns>An instance of MapRegion containing the data in the record</returns>
        public static MapRegion LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			MapRegion record = null;
//			record = MapRegion.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where MapRegionID=", Sql.Sqlize(id));
//				record = new MapRegion();
//				if (!record.LoadData(sql)) return otherwise.Execute<MapRegion>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <MapRegion>(id, "MapRegion", otherwise));
        }
예제 #14
0
        /// <summary>
        /// Loads a record from the Event table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg Event.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = Event.LoadID(55);</example>
        /// <param name="id">Primary key of Event</param>
        /// <returns>An instance of Event containing the data in the record</returns>
        public static Event LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			Event record = null;
//			record = Event.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where EventID=", Sql.Sqlize(id));
//				record = new Event();
//				if (!record.LoadData(sql)) return otherwise.Execute<Event>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <Event>(id, "Event", otherwise));
        }
예제 #15
0
        /// <summary>
        /// Loads a record from the Settings table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg Settings.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = Settings.LoadID(55);</example>
        /// <param name="id">Primary key of Settings</param>
        /// <returns>An instance of Settings containing the data in the record</returns>
        public static Settings LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			Settings record = null;
//			record = Settings.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where SettingsID=", Sql.Sqlize(id));
//				record = new Settings();
//				if (!record.LoadData(sql)) return otherwise.Execute<Settings>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <Settings>(id, "Settings", otherwise));
        }
예제 #16
0
        /// <summary>
        /// Loads a record from the AutocompletePhrase table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg AutocompletePhrase.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = AutocompletePhrase.LoadID(55);</example>
        /// <param name="id">Primary key of AutocompletePhrase</param>
        /// <returns>An instance of AutocompletePhrase containing the data in the record</returns>
        public static AutocompletePhrase LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			AutocompletePhrase record = null;
//			record = AutocompletePhrase.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where AutocompletePhraseID=", Sql.Sqlize(id));
//				record = new AutocompletePhrase();
//				if (!record.LoadData(sql)) return otherwise.Execute<AutocompletePhrase>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <AutocompletePhrase>(id, "AutocompletePhrase", otherwise));
        }
예제 #17
0
        /// <summary>
        /// Loads a record from the Testimonial table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg Testimonial.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = Testimonial.LoadID(55);</example>
        /// <param name="id">Primary key of Testimonial</param>
        /// <returns>An instance of Testimonial containing the data in the record</returns>
        public static Testimonial LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			Testimonial record = null;
//			record = Testimonial.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where TestimonialID=", Sql.Sqlize(id));
//				record = new Testimonial();
//				if (!record.LoadData(sql)) return otherwise.Execute<Testimonial>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <Testimonial>(id, "Testimonial", otherwise));
        }
예제 #18
0
        /// <summary>
        /// Loads a record from the Banner table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg Banner.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = Banner.LoadID(55);</example>
        /// <param name="id">Primary key of Banner</param>
        /// <returns>An instance of Banner containing the data in the record</returns>
        public static Banner LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			Banner record = null;
//			record = Banner.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where BannerID=", Sql.Sqlize(id));
//				record = new Banner();
//				if (!record.LoadData(sql)) return otherwise.Execute<Banner>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <Banner>(id, "Banner", otherwise));
        }
예제 #19
0
        /// <summary>
        /// Loads a record from the NewsRSS table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg NewsRSS.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = NewsRSS.LoadID(55);</example>
        /// <param name="id">Primary key of NewsRSS</param>
        /// <returns>An instance of NewsRSS containing the data in the record</returns>
        public static NewsRSS LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			NewsRSS record = null;
//			record = NewsRSS.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where NewsRSSID=", Sql.Sqlize(id));
//				record = new NewsRSS();
//				if (!record.LoadData(sql)) return otherwise.Execute<NewsRSS>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <NewsRSS>(id, "NewsRSS", otherwise));
        }
예제 #20
0
 /// <summary>
 /// Loads a record from the FAQItem table in the database given the supplied primary key value.
 /// If found in the cache, record will be loaded from the cache.
 /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg FAQItem.LoadID(55, Otherwise.Null) will return null if not found.
 /// </summary>
 /// <example>var g = FAQItem.LoadID(55);</example>
 /// <param name="id">Primary key of FAQItem</param>
 /// <returns>An instance of FAQItem containing the data in the record</returns>
 public static FAQItem LoadID(int id, Otherwise otherwise)
 {
     // see if already in cache, else create sql and load
     //			FAQItem record = null;
     //			record = FAQItem.GetFromCache(id); //comment out if not int pk type
     //			if (record == null)
     //			{
     //				var sql = new Sql("where FAQItemID=", Sql.Sqlize(id));
     //				record = new FAQItem();
     //				if (!record.LoadData(sql)) return otherwise.Execute<FAQItem>();
     //				record.StoreInCache();
     //			}
     //			return record;
         return ActiveRecordLoader.LoadID<FAQItem>(id, "FAQItem", otherwise);
 }
예제 #21
0
        /// <summary>
        /// Loads a record from the HomepageSlide table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg HomepageSlide.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = HomepageSlide.LoadID(55);</example>
        /// <param name="id">Primary key of HomepageSlide</param>
        /// <returns>An instance of HomepageSlide containing the data in the record</returns>
        public static HomepageSlide LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			HomepageSlide record = null;
//			record = HomepageSlide.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where HomepageSlideID=", Sql.Sqlize(id));
//				record = new HomepageSlide();
//				if (!record.LoadData(sql)) return otherwise.Execute<HomepageSlide>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <HomepageSlide>(id, "HomepageSlide", otherwise));
        }
예제 #22
0
        /// <summary>
        /// Loads a record from the DocumentDownload table in the database given the supplied primary key value.
        /// If found in the cache, record will be loaded from the cache.
        /// If NOT FOUND, you can specify the behaviour with Beweb.Otherwise - eg DocumentDownload.LoadID(55, Otherwise.Null) will return null if not found.
        /// </summary>
        /// <example>var g = DocumentDownload.LoadID(55);</example>
        /// <param name="id">Primary key of DocumentDownload</param>
        /// <returns>An instance of DocumentDownload containing the data in the record</returns>
        public static DocumentDownload LoadID(int id, Otherwise otherwise)
        {
            // see if already in cache, else create sql and load
//			DocumentDownload record = null;
//			record = DocumentDownload.GetFromCache(id); //comment out if not int pk type
//			if (record == null)
//			{
//				var sql = new Sql("where DocumentDownloadID=", Sql.Sqlize(id));
//				record = new DocumentDownload();
//				if (!record.LoadData(sql)) return otherwise.Execute<DocumentDownload>();
//				record.StoreInCache();
//			}
//			return record;
            return(ActiveRecordLoader.LoadID <DocumentDownload>(id, "DocumentDownload", otherwise));
        }