public static string Teaser(this string s, IVauctionConfiguration config) { char[] anyOf = config.GetProperty("Punctuation").ToCharArray(); int TeaserLenght = Convert.ToInt32(config.GetProperty("TeaserLenght")); return(s.Substring(0, s.IndexOfAny(anyOf, TeaserLenght) + 1)); }
public static string Teaser(this string s, IVauctionConfiguration config) { char[] anyOf = config.GetProperty("Punctuation").ToCharArray(); int TeaserLenght = Convert.ToInt32( config.GetProperty("TeaserLenght") ); return s.Substring(0, s.IndexOfAny(anyOf, TeaserLenght) + 1); }
//public static IUserRepository UserRepository { get; protected set; } //protected IEventRepository EventRepository { get; set; } //protected IAuctionRepository AuctionRepository { get; set; } //protected IBidRepository BidRepository { get; set; } //protected IInvoiceRepository InvoiceRepository { get; set; } //protected IGeneralRepository GeneralRepository { get; set; } //protected ICategoryRepository CategoryRepository { get; set; } //protected IReportRepository ReportRepository { get; set; } public BaseController() { Config = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction"); dataProvider = Config.DataProvider.GetInstance(); //UserRepository = dataProvider.UserRepository; //EventRepository = dataProvider.EventRepository; //AuctionRepository = dataProvider.AuctionRepository; //BidRepository = dataProvider.BidRepository; //InvoiceRepository = dataProvider.InvoiceRepository; //GeneralRepository = dataProvider.GeneralRepository; //CategoryRepository = dataProvider.CategoryRepository; //ReportRepository = dataProvider.ReportRepository; }
public static string GetProperty(this IVauctionConfiguration config, string name) { string property_value = String.Empty; if (dictionaryProperties == null) { dictionaryProperties = new Dictionary <string, string>(); } if (dictionaryProperties.ContainsKey(name)) { property_value = dictionaryProperties[name]; } else { if (config != null) { foreach (IPropertyConfiguration property in config.Property) { if (property.Name == name) { property_value = property.Value; break; } } if (!String.IsNullOrEmpty(property_value)) { try { if (!dictionaryProperties.ContainsKey(name)) { dictionaryProperties.Add(name, property_value); } } catch (Exception e) { Logger.LogException(e); } } else { throw new Exception(string.Format("Could not find property: '{0}'", name)); } } } return(property_value); }
public static string Text(this DateTime values) { IVauctionConfiguration config = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction"); return(Text(values, config.GetProperty("DateFormat"))); }
public static string Text(this DateTime values, IVauctionConfiguration config) { return(Text(values, config.GetProperty("DateFormat"))); }
public BaseController() { Config = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction"); dataProvider = Config.DataProvider.GetInstance(); }
public static int GetIntProperty(this IVauctionConfiguration config, string name) { return(Convert.ToInt32(GetProperty(config, name))); }
public static string Text(this DateTime values, IVauctionConfiguration config) { return Text(values, config.GetProperty("DateFormat") ); }