Beispiel #1
0
        internal DataSet GetTickerData_Rate(DateTime PriceDate)
        {
            SqlCommand sqlCom = new SqlCommand("spOTCOptionPrice_GetBBTickers_RiskFreeRate");

            sqlCom.CommandType = CommandType.StoredProcedure;
            sqlCom.Parameters.Add(new SqlParameter("@PriceDate", PriceDate));
            DataSet ds = db.FetchData(sqlCom);

            return(ds);
        }
Beispiel #2
0
        private static DataSet GetData(string server, string database, string sql)
        {
            var db = new SQLServer(server, database, "", "")
            {
                Timeout          = 0,
                NTauthentication = true
            };
            // no timeout

            DataSet ds;

            try
            {
                SqlCommand c = new SqlCommand(sql)
                {
                    CommandType = CommandType.Text
                };
                ds = db.FetchData(c);
            }
            catch (Exception e)
            {
                Exception e2 = new Exception(sql, e);
                throw e2;
            }
            finally
            {
                db.Close();
            }
            return(ds);
        }
Beispiel #3
0
        /// <summary>
        /// get a list of all of the options that we want to price (i.e. ones we have a balance in)
        /// </summary>
        /// <param name="ValuationDate"></param>
        /// <returns></returns>
        internal List <BOSSOption> GetBOSSOptionsToPrice(DateTime ValuationDate)
        {
            List <BOSSOption> options = new List <BOSSOption>();
            SqlCommand        sqlCom  = new SqlCommand("spOTCOptionPrice_GetSecuritiesToPrice");

            sqlCom.CommandType = CommandType.StoredProcedure;
            sqlCom.Parameters.Add(new SqlParameter("@PriceDate", ValuationDate));
            DataSet ds = db.FetchData(sqlCom);

            if (ds.Tables[0].Rows.Count != 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    //get static data
                    int        SecurityID = int.Parse(dr["SecurityID"].ToString());
                    BOSSOption o          = GetBOSSOption(SecurityID, ValuationDate);
                    options.Add(o);
                }
            }
            return(options);
        }