コード例 #1
0
        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));
        }
コード例 #2
0
		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);
		}
コード例 #3
0
    //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;
    }
コード例 #4
0
        //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;
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public static string Text(this DateTime values)
        {
            IVauctionConfiguration config = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction");

            return(Text(values, config.GetProperty("DateFormat")));
        }
コード例 #7
0
 public static string Text(this DateTime values, IVauctionConfiguration config)
 {
     return(Text(values, config.GetProperty("DateFormat")));
 }
コード例 #8
0
 public BaseController()
 {
     Config       = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction");
     dataProvider = Config.DataProvider.GetInstance();
 }
コード例 #9
0
 public static int GetIntProperty(this IVauctionConfiguration config, string name)
 {
     return(Convert.ToInt32(GetProperty(config, name)));
 }
コード例 #10
0
 public BaseController()
 {
   Config = (IVauctionConfiguration)ConfigurationManager.GetSection("Vauction");
   dataProvider = Config.DataProvider.GetInstance();
 }
コード例 #11
0
		public static string Text(this DateTime values, IVauctionConfiguration config)
		{
			return Text(values, config.GetProperty("DateFormat") );
		}