示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Quotes = new ObservableCollection<Quote>();
            db = new DBAccess();
            //Some example tickers
            Quotes.Add(new Quote(textBox1.Text.ToUpper()));
            //get the data
            YahooStockEngine.Fetch(Quotes);
            try
            {
                db.insert_stock(textBox1.Text.ToUpper(), Quotes[0].LastUpdate, Quotes[0].DividendShare, Quotes[0].Name, Quotes[0].StockExchange, Quotes[0].ChangeInPercent,
                    Quotes[0].LastTradePrice, Quotes[0].Volume, Quotes[0].YearlyHigh, Quotes[0].YearlyLow, Quotes[0].DailyHigh, Quotes[0].DailyLow, Quotes[0].PeRatio);

                db.insert_stockhistory(DateTime.Now, "BUY", decimal.Parse(textBox2.Text), acct, db.select_stock(textBox1.Text.ToUpper()));

            }
            catch
            {

                Console.WriteLine("error");

            }

            this.Close();
        }
示例#2
0
 public Form1(int user_id1, int account_id1)
 {
     db = new DBAccess();
     user_id = user_id1;
     account_id = account_id1;
     this.contructors();
 }
示例#3
0
        public Add_User()
        {
            InitializeComponent();
            db = new DBAccess();
            DataTable dt = db.select_allquestions();
            foreach (DataRow dr in dt.Rows)
            {
                comboBox1.Items.Add(dr[0].ToString());

            }
        }
示例#4
0
        public accounts(string username1, string password1)
        {
            db = new DBAccess();
            username = username1;
            password = password1;
            InitializeComponent();
               DataTable dt=db.select_allaccountid(username, password);
               foreach (DataRow dr in dt.Rows)
               {
               comboBox1.Items.Add(dr[1].ToString() + ":" + dr[0].ToString());

               }
               user_id = db.select_userid(username, password);
        }
示例#5
0
 public newaccounts(int user_id)
 {
     InitializeComponent();
     db = new DBAccess();
     user_id1 = user_id;
 }
示例#6
0
        public forgotpassword()
        {
            InitializeComponent();

            db = new DBAccess();
        }
示例#7
0
 public Bonds(int account_id1)
 {
     account_id = account_id1;
     InitializeComponent();
     db = new DBAccess();
 }
示例#8
0
 public loginbox()
 {
     InitializeComponent();
     db = new DBAccess();
 }
示例#9
0
 public investment(int account_id1)
 {
     account_id = account_id1;
     InitializeComponent();
     db = new DBAccess();
 }
示例#10
0
 public Cash(int acctid)
 {
     InitializeComponent();
     accountid = acctid;
     db = new DBAccess();
 }
示例#11
0
 public CD(int account_id1)
 {
     account_id = account_id1;
     InitializeComponent();
     db = new DBAccess();
 }