Exemplo n.º 1
0
        public PortfolioList Load()
        {
            PortfolioList portfolioList = new PortfolioList();
            IDbCommand    command       = this.connection.CreateCommand();
//      command.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(6566);
            IDataReader dataReader = command.ExecuteReader();

            while (dataReader.Read())
            {
                int       int32     = dataReader.GetInt32(0);
                string    string1   = dataReader.GetString(1);
                string    string2   = dataReader.GetString(2);
                string    string3   = dataReader.GetString(3);
                string    string4   = dataReader.GetString(4);
                bool      flag      = !dataReader.IsDBNull(5) && dataReader.GetBoolean(5);
                Portfolio portfolio = (Portfolio)Activator.CreateInstance(Type.GetType(string.Format("ds", string2, string1)), true);
                portfolio.Id          = int32;
                portfolio.Name        = string3;
                portfolio.Description = string4;
                portfolio.U70sR7lQYS(flag);
                portfolioList.Add(portfolio);
            }
            dataReader.Close();
            command.Dispose();
            foreach (Portfolio portfolio in portfolioList)
            {
                this.DdBEZNiZyZ(portfolio);
            }
            return(portfolioList);
        }
Exemplo n.º 2
0
        public PortfolioList Load()
        {
            PortfolioList portfolioList = new PortfolioList();
            IDbCommand command = this.connection.CreateCommand();
//      command.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(6566);
            IDataReader dataReader = command.ExecuteReader();
            while (dataReader.Read())
            {
                int int32 = dataReader.GetInt32(0);
                string string1 = dataReader.GetString(1);
                string string2 = dataReader.GetString(2);
                string string3 = dataReader.GetString(3);
                string string4 = dataReader.GetString(4);
                bool flag = !dataReader.IsDBNull(5) && dataReader.GetBoolean(5);
                Portfolio portfolio = (Portfolio)Activator.CreateInstance(Type.GetType(string.Format("ds", string2, string1)), true);
                portfolio.Id = int32;
                portfolio.Name = string3;
                portfolio.Description = string4;
                portfolio.U70sR7lQYS(flag);
                portfolioList.Add(portfolio);
            }
            dataReader.Close();
            command.Dispose();
            foreach (Portfolio portfolio in portfolioList)
                this.DdBEZNiZyZ(portfolio);
            return portfolioList;
        }
Exemplo n.º 3
0
		static PortfolioManager()
		{
			PortfolioManager.pricer = new PortfolioPricer();

			Type connectionType = null;
			string connectionString = string.Empty;
			switch (Framework.Storage.ServerType)
			{
                case DbServerType.SQLITE:
                    connectionType = Type.GetType("SQLiteConnection");
                    connectionString = string.Format("Data Source={0};Pooling=true;FailIfMissing=false;", Path.Combine(Framework.Installation.DataDir.FullName, "freequant.db"));
                    break;
                default:
                    throw new NotSupportedException("This db is not support yet.");
            }

//            PortfolioManager.server = new PortfolioDbServer();
            PortfolioManager.server = new PortfolioFileServer();
			PortfolioManager.server.Open(connectionType, connectionString);
			PortfolioManager.portfolios = PortfolioManager.server.Load();
		}
Exemplo n.º 4
0
        static PortfolioManager()
        {
            PortfolioManager.pricer = new PortfolioPricer();

            Type   connectionType   = null;
            string connectionString = string.Empty;

            switch (Framework.Storage.ServerType)
            {
            case DbServerType.SQLITE:
                connectionType   = Type.GetType("SQLiteConnection");
                connectionString = string.Format("Data Source={0};Pooling=true;FailIfMissing=false;", Path.Combine(Framework.Installation.DataDir.FullName, "freequant.db"));
                break;

            default:
                throw new NotSupportedException("This db is not support yet.");
            }

//            PortfolioManager.server = new PortfolioDbServer();
            PortfolioManager.server = new PortfolioFileServer();
            PortfolioManager.server.Open(connectionType, connectionString);
            PortfolioManager.portfolios = PortfolioManager.server.Load();
        }