public void Remove(Portfolio portfolio)
        {
            this.ospEgWBc0j(portfolio);
            this.GG5E1xwBnb(portfolio);
            IDbCommand command = this.connection.CreateCommand();

            command.CommandText = "command11";
            FIXDbServer.SetCommandParameter(command, "dd", DbType.Int32, (object)portfolio.Id);
            command.ExecuteNonQuery();
            command.Dispose();
        }
Exemple #2
0
 public void Remove(IOrder order)
 {
     lock (this)
     {
         IDbCommand cmd = this.connection.CreateCommand();
         cmd.CommandText = "";
         FIXDbServer.SetCommandParameter(cmd, "name", DbType.Int32, (object)order.Id);
         cmd.ExecuteNonQuery();
         cmd.Dispose();
     }
 }
Exemple #3
0
 public OrderList Load()
 {
     lock (this)
     {
         OrderList  orders  = new OrderList();
         IDbCommand command = this.connection.CreateCommand();
         // TODO:
         command.CommandText = "select order from";
         IDataReader reader = command.ExecuteReader();
         while (reader.Read())
         {
             int    orderId      = reader.GetInt32(0);
             Type   orderType    = this.jW5iqEmeD[reader.GetInt32(1)];
             int    instrumentId = reader.IsDBNull(2) ? -1 : reader.GetInt32(2);
             int    providerId   = reader.IsDBNull(3) ? -1 : reader.GetInt32(3);
             int    portfolioId  = reader.IsDBNull(4) ? -1 : reader.GetInt32(4);
             IOrder order        = (IOrder)Activator.CreateInstance(orderType, true);
             order.Id         = orderId;
             order.Instrument = InstrumentManager.Instruments.GetById(instrumentId);
             order.Provider   = ProviderManager.ExecutionProviders[(byte)providerId];
             order.Portfolio  = PortfolioManager.Portfolios.GetById(portfolioId);
             order.Persistent = true;
             orders.Add(order);
         }
         reader.Close();
         command.Dispose();
         FIXDbServer.LoadFIXGroups(this.connection, orders, "order.table");
         ExecutionReportList reports = new ExecutionReportList();
         IDbCommand          cmd     = this.connection.CreateCommand();
         cmd.CommandText = "commadn";
         IDataReader reader2 = cmd.ExecuteReader();
         while (reader2.Read())
         {
             int             reportId = reader2.GetInt32(0);
             int             orderId  = reader2.GetInt32(1);
             ExecutionReport report   = new ExecutionReport();
             report.Id = reportId;
             orders.GetById(orderId).Reports.Add(report);
             reports.Add(report);
         }
         reader2.Close();
         cmd.Dispose();
         FIXDbServer.LoadFIXGroups(this.connection, reports, "report.table");
         return(orders);
     }
 }
Exemple #4
0
 public void AddReport(IOrder order, FIXExecutionReport report)
 {
     lock (this)
     {
         FIXDbServer.RemoveFIXGroup(this.connection, "atable", order.Id);
         FIXDbServer.SaveFIXGroup(this.connection, (FIXGroup)(order as SingleOrder), "ordertable", order.Id);
         IDbCommand cmd = this.connection.CreateCommand();
         cmd.CommandText = "";
         FIXDbServer.SetCommandParameter(cmd, "atable", DbType.Int32, order.Id);
         cmd.ExecuteNonQuery();
         cmd.Dispose();
         IDbCommand cmd2 = this.connection.CreateCommand();
         cmd2.CommandText = "";
         report.Id        = Convert.ToInt32(cmd2.ExecuteScalar());
         cmd2.Dispose();
         FIXDbServer.SaveFIXGroup(this.connection, report, "report.table", report.Id);
     }
 }
Exemple #5
0
        private int Hblu18jwZ(IOrder order)
        {
            Type type = order.GetType();

            if (!this.t1OfD4U1U.ContainsKey(type))
            {
                string     str      = type.FullName + "" + type.Assembly.GetName().Name;
                IDbCommand command1 = this.connection.CreateCommand();
                command1.CommandText = "";
                FIXDbServer.SetCommandParameter(command1, "name", DbType.String, string.Format("format", (object)type.FullName, (object)type.Assembly.GetName().Name));
                command1.ExecuteNonQuery();
                command1.Dispose();
                IDbCommand command2 = this.connection.CreateCommand();
                command2.CommandText = "";
                int key = Convert.ToInt32(command2.ExecuteScalar());
                command2.Dispose();
                this.jW5iqEmeD.Add(key, type);
                this.t1OfD4U1U.Add(type, key);
            }
            return(this.t1OfD4U1U[type]);
        }
Exemple #6
0
        public void AddOrder(IOrder order)
        {
            if (order.Id != -1)
            {
                throw new InvalidOperationException("");
            }
            lock (this)
            {
                IDbCommand local_0 = this.connection.CreateCommand();
//        local_0.CommandText = p9eligYgcNHo8cieFV.RdvEpVlLR7(756);
//        FIXDbServer.SetCommandParameter(local_0, p9eligYgcNHo8cieFV.RdvEpVlLR7(1004), DbType.Int32, (object) this.Hblu18jwZ(order));
//        FIXDbServer.SetCommandParameter(local_0, p9eligYgcNHo8cieFV.RdvEpVlLR7(1022), DbType.Int32, (object) order.Instrument.Id);
//        FIXDbServer.SetCommandParameter(local_0, p9eligYgcNHo8cieFV.RdvEpVlLR7(1052), DbType.Int32, (object) order.Provider.Id);
//        FIXDbServer.SetCommandParameter(local_0, p9eligYgcNHo8cieFV.RdvEpVlLR7(1078), DbType.Int32, (object) order.Portfolio.Id);
                local_0.ExecuteNonQuery();
                local_0.Dispose();
                IDbCommand local_0_1 = this.connection.CreateCommand();
                local_0_1.CommandText = "";
                order.Id = Convert.ToInt32(local_0_1.ExecuteScalar());
                local_0_1.Dispose();
                FIXDbServer.SaveFIXGroup(this.connection, (FIXGroup)(order as SingleOrder), "", order.Id);
            }
        }
        private void DdBEZNiZyZ(Portfolio obj0)
        {
            obj0.LwTsbC870d(true);
            IDbCommand command1 = this.connection.CreateCommand();
//      command1.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(7996);
//      FIXDbServer.SetCommandParameter(command1, gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8138), DbType.Int32, (object) obj0.Id);
            IDataReader dataReader1 = command1.ExecuteReader();

            while (dataReader1.Read())
            {
                int int32_1 = dataReader1.GetInt32(0);
                dataReader1.GetInt32(1);
                string      string1     = dataReader1.GetString(2);
                int         int32_2     = dataReader1.GetInt32(3);
                DateTime    dateTime    = dataReader1.GetDateTime(4);
                int         int32_3     = dataReader1.GetInt32(5);
                string      string2     = dataReader1.GetString(6);
                double      double1     = dataReader1.GetDouble(7);
                double      double2     = dataReader1.GetDouble(8);
                string      string3     = dataReader1.GetString(9);
                string      string4     = dataReader1.GetString(10);
                string      string5     = dataReader1.GetString(11);
                double      double3     = dataReader1.GetDouble(12);
                string      string6     = dataReader1.GetString(13);
                Transaction transaction = new Transaction();
                transaction.nx8WA03O1L(int32_1);
                transaction.ClOrdID    = string1;
                transaction.ReportId   = int32_2;
                transaction.DateTime   = dateTime;
                transaction.Instrument = InstrumentManager.Instruments.GetById(int32_3);
                transaction.Side       = FIXSide.FromFIX(string2[0]);
                transaction.Price      = double1;
                transaction.Qty        = double2;
                transaction.Text       = string3;
                TransactionCost transactionCost = (TransactionCost)Activator.CreateInstance(Type.GetType(string.Format("s", (object)string5, (object)string4)), true);
                transactionCost.CommType    = FIXCommType.FromFIX(string6[0]);
                transactionCost.Commission  = double3;
                transaction.TransactionCost = transactionCost;
                if (transaction.Instrument == null)
                {
                    transaction.Instrument = this.xKIEA4RkYI(int32_3);
                }
                obj0.Add(transaction);
            }
            dataReader1.Close();
            command1.Dispose();
            IDbCommand command2 = this.connection.CreateCommand();

//      command2.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8180);
            FIXDbServer.SetCommandParameter(command2, "sss", DbType.Int32, (object)obj0.Id);
            IDataReader dataReader2 = command2.ExecuteReader();

            while (dataReader2.Read())
            {
                int int32 = dataReader2.GetInt32(0);
                dataReader2.GetInt32(1);
                DateTime           dateTime    = dataReader2.GetDateTime(2);
                string             @string     = dataReader2.GetString(3);
                double             @double     = dataReader2.GetDouble(4);
                string             str         = dataReader2.IsDBNull(5) ? "" : dataReader2.GetString(5);
                AccountTransaction transaction = new AccountTransaction();
                transaction.G7YBAhR7LA(int32);
                transaction.DateTime = dateTime;
                transaction.Currency = CurrencyManager.Currencies[@string];
                transaction.Value    = @double;
                transaction.Text     = str;
                obj0.Account.Add(transaction);
            }
            dataReader2.Close();
            command2.Dispose();
            obj0.LwTsbC870d(false);
        }
Exemple #8
0
        public InstrumentList Load()
        {
            IDbCommand command1 = this.connection.CreateCommand();

            command1.CommandText = "comdd";
            IDataReader dataReader1 = command1.ExecuteReader();

            while (dataReader1.Read())
            {
                int  int32 = dataReader1.GetInt32(0);
                Type type  = Type.GetType(dataReader1.GetString(1));
                this.aKpdKBGUfP.Add(int32, type);
                this.cVFd9nJe3b.Add(type, int32);
            }
            dataReader1.Close();
            command1.Dispose();
            IDbCommand command2 = this.connection.CreateCommand();

            command2.CommandText = "load";
            IDataReader dataReader2 = command2.ExecuteReader();

            while (dataReader2.Read())
            {
                int  int32 = dataReader2.GetInt32(0);
                Type type  = Type.GetType(dataReader2.GetString(1));
                this.BuYdCExFpF.Add(int32, type);
                this.UXKdMsMyXN.Add(type, int32);
            }
            dataReader2.Close();
            command2.Dispose();
            InstrumentList instrumentList = new InstrumentList();
            IDbCommand     command3       = this.connection.CreateCommand();

            command3.CommandText = "load";
            IDataReader dataReader3 = command3.ExecuteReader();

            while (dataReader3.Read())
            {
                int        int32      = dataReader3.GetInt32(0);
                Type       type1      = this.aKpdKBGUfP[dataReader3.GetInt32(1)];
                Type       type2      = this.BuYdCExFpF[dataReader3.GetInt32(2)];
                string     @string    = dataReader3.GetString(3);
                Instrument instrument = Activator.CreateInstance(type1, true) as Instrument;
                IPricer    pricer     = Activator.CreateInstance(type2) as IPricer;
                instrument.Symbol = @string;
                instrument.Id     = int32;
                instrument.Pricer = pricer;
                if (instrumentList[@string] == null)
                {
                    instrumentList.Add(instrument);
                }
            }
            dataReader3.Close();
            command3.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)instrumentList, "fsdfs");
            LegList    legList  = new LegList();
            IDbCommand command4 = this.connection.CreateCommand();

            command4.CommandText = "load";
            IDataReader dataReader4 = command4.ExecuteReader();

            while (dataReader4.Read())
            {
                int int32_1 = dataReader4.GetInt32(0);
                int int32_2 = dataReader4.GetInt32(1);
                int int32_3 = dataReader4.GetInt32(2);
                Leg leg     = new Leg(instrumentList.GetById(int32_3));
                leg.Id = int32_1;
                instrumentList.GetById(int32_2).Legs.Add((FIXGroup)leg);
                legList.Add((FIXGroup)leg);
            }
            dataReader4.Close();
            command4.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)legList, "");
            UnderlyingList underlyingList = new UnderlyingList();
            IDbCommand     command5       = this.connection.CreateCommand();

            command5.CommandText = "load";
            IDataReader dataReader5 = command5.ExecuteReader();

            while (dataReader5.Read())
            {
                int        int32_1    = dataReader5.GetInt32(0);
                int        int32_2    = dataReader5.GetInt32(1);
                int        int32_3    = dataReader5.GetInt32(2);
                Underlying underlying = new Underlying(instrumentList.GetById(int32_3));
                underlying.Id = int32_1;
                instrumentList.GetById(int32_2).Underlyings.Add((FIXGroup)underlying);
                underlyingList.Add((FIXGroup)underlying);
            }
            dataReader5.Close();
            command5.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)underlyingList, "dss");
            FIXSecurityAltIDGroupList securityAltIdGroupList = new FIXSecurityAltIDGroupList();
            IDbCommand command6 = this.connection.CreateCommand();

            command6.CommandText = "load";
            IDataReader dataReader6 = command6.ExecuteReader();

            while (dataReader6.Read())
            {
                int int32_1 = dataReader6.GetInt32(0);
                int int32_2 = dataReader6.GetInt32(1);
                FIXSecurityAltIDGroup securityAltIdGroup = new FIXSecurityAltIDGroup();
                securityAltIdGroup.Id = int32_1;
                instrumentList.GetById(int32_2).SecurityAltIDGroup.Add((FIXGroup)securityAltIdGroup);
                securityAltIdGroupList.Add((FIXGroup)securityAltIdGroup);
            }
            dataReader6.Close();
            command6.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)securityAltIdGroupList, "fsfs");
            return(instrumentList);
        }