Exemplo n.º 1
0
        private string GetPriorDate()
        {
            strUserIdentity = "fountainhead\bgoff";
            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            _dataRepository = config.GetRepository("Persistence");

            Hashtable ht = new Hashtable();
            ht["date"] = DateTime.Now.Date;
            ht["CountryArr"] = "US";

            DataSet ds = GetDataSet("Persistence", "Persistence.StaarsConversion_GetPriorDate", ht);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                return ((DateTime)ds.Tables[0].Rows[0][0]).ToShortDateString();
            else
                return String.Empty;
        }
Exemplo n.º 2
0
        private static DataSet GetDataSet(string repository, string alias, Hashtable ht)
        {
            DataSet ds = new DataSet();

            config = new ConfigHelper();
            _dataRepository = config.GetRepository(repository);

            if (ht != null)
                ds = _dataRepository.LoadDataSet(alias, ht);
            else
                ds = _dataRepository.LoadDataSet(alias);

            return ds;
        }
Exemplo n.º 3
0
        public override int Execute(Object o, Hashtable inputData)
        {
            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o );

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            strUserIdentity = "fountainhead\bgoff";
            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            _dataRepository = config.GetRepository(repositoryName);

            DataSet ds = GetDataSet(repositoryName, sqlAlias, null);
            AddToOutputs(this.Name, ds);

            //Hashtable ht = new Hashtable();
            //foreach (Object oIn in inputData)
            //{
            //    DataTable dt = oIn as DataTable;
            //    foreach (DataRow dr in dt.Rows)
            //    {
            //        GetDataSet(repositoryName, sqlAlias, null);
            //    }
            //}

            int activityIdEnding = UpdateProcessStatus(Enums.ProcessStatus.Success, "", (State)o );

            log.InfoFormat(job.KeyCode, "PersistenceAdapter executed.");
            return 0;
        }
Exemplo n.º 4
0
        public override int Execute(Object o, Hashtable inputData)
        {
            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o );

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            strUserIdentity = "fountainhead\bgoff";
            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            _dataRepository = config.GetRepository("GenevaPersistence");

            Hashtable ht = new Hashtable();
            foreach (Object oIn in inputData)
            {
                DataTable dt = oIn as DataTable;
                foreach (DataRow dr in dt.Rows)
                {
                    ht.Clear();

                    switch (columnMapMode)
                    {
                        case 0:
                            for (int i = 0; i < columnCount; i++)
                                ht[dt.Columns[i].ColumnName] = dr[i];
                            break;
                    }

                    //string pquery = String.Format("GenevaPersistence.{0}", query);
                    GetDataSet("GenevaPersistence", query, ht);
                }
            }

            int activityIdEnding = UpdateProcessStatus(Enums.ProcessStatus.Success, "", (State)o );

            log.InfoFormat(job.KeyCode, "GenevaPersistenceAdapter executed.");
            return 0;
        }
Exemplo n.º 5
0
        public override int Execute(Object o, Hashtable inputData)
        {
            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o );

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            strUserIdentity = "fountainhead\bgoff";
            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            _dataRepository = config.GetRepository("PersistenceAdapter");

            Hashtable ht = new Hashtable();
            foreach (Object oIn in inputData)
            {
                DataTable dt = oIn as DataTable;
                foreach (DataRow dr in dt.Rows)
                {
                    ht.Clear();

                    ht["entryDate"] = dr[0];
                    ht["datasource"] = dr[1];
                    ht["tradeDate"] = dr[2];
                    ht["symbol"] = dr[3];
                    ht["side"] = dr[4];
                    ht["quantity"] = dr[5];
                    ht["price"] = dr[6];

                    GetDataSet("Persistence", "Persistence.13fReport_SaTradeDelete", ht);
                    GetDataSet("Persistence", "Persistence.13fReport_SaTradeInsert", ht);
                }
            }

            int activityIdEnding = UpdateProcessStatus(Enums.ProcessStatus.DoneSuccess, "", (State)o );

            log.InfoFormat("PersistenceAdapter executed.");
            return 0;
        }
Exemplo n.º 6
0
        private string GetCat1CodeFromAccount(string account)
        {
            string strUserIdentity = "fountainhead\bgoff";
            string LE = String.Empty;

            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            repository = config.GetRepository("SqlPersistence");

            Hashtable ht = new Hashtable();
            ht["Account"] = account;

            DataSet ds = repository.LoadDataSet("Sql.GetCat1CodeFromAccount", ht);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                LE = ds.Tables[0].Rows[0][0].ToString();

            return LE;
        }
Exemplo n.º 7
0
        private double GetCommAndFees(string chargeType, string assetClass, string broker, string underlyingAssetClass, string product, string cat1Code,
            string country, string exchange, string buySell, double price, double quantity, double mktValue)
        {
            string strUserIdentity = "fountainhead\bgoff";

            GenericIdentity objGenericIdentity = new GenericIdentity(strUserIdentity);
            CredentialPrincipal credPrincipal = new BAM.Repository.CredentialPrincipal(objGenericIdentity, null, strPerms); ;

            config = new ConfigHelper();
            repository = config.GetRepository("SqlPersistence");

            Hashtable ht = new Hashtable();
            ht["ChargeType"] = chargeType;
            ht["AssetClass"] = assetClass;
            ht["Broker"] = broker;
            ht["UnderlyingAssetClass"] = underlyingAssetClass;
            ht["Product"] = product;
            ht["Cat1Code"] = cat1Code;
            ht["Country"] = country;
            ht["Exchange"] = exchange;
            ht["BuySell"] = buySell;
            ht["Price"] = price;
            ht["Quantity"] = quantity;
            ht["Price"] = price;
            ht["MarketValue"] = mktValue;
            ht["Price"] = price;
            ht["commission"] = null;
            ht["currency"] = null;

            //DataSet ds = Bam.Framework.Service.Persistence.Repository.GetRepository(repository.Name,
            //        repository.Type, repository.ConnectionString, repository.AliasDirectory).LoadDataSet("Sql.GetCommission", ht);
            DataSet ds = repository.LoadDataSet("Sql.GetCommission", ht);

            double expense = 0;
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                if (!ds.Tables[0].Rows[0]["Commission"].Equals(DBNull.Value))
                    expense = Convert.ToDouble(ds.Tables[0].Rows[0]["Commission"]);

            return expense;
        }