private void btnSSIS_Click(object sender, EventArgs e) { SSIS.tsEntities alDb = new SSIS.tsEntities(); alDb.PopulateNewFromFile(@"E:\vivek\SQL\SQL\SQL Migration\SSIS\ar-per\new.txt"); alDb.PopulateArFromFile(@"E:\vivek\SQL\SQL\SQL Migration\SSIS\ar-per\ar.txt"); alDb.PopulatePerFromFile(@"E:\vivek\SQL\SQL\SQL Migration\SSIS\ar-per\per.txt"); }
private void btnSearchSym_Click(object sender, EventArgs e) { txtQuery.Text = string.Empty; string[] syml = txtSym.Text.Trim().Split('-'); string sym = syml[0]; string ex = syml[1]; { txtQuery.Text += "select * from pr where pr.rt = trim('" + sym + "'); " + Environment.NewLine; txtQuery.Text += "select * from ar_view where ar_view.rt = trim('" + sym + "');" + Environment.NewLine; txtQuery.Text += "select * from per where per.rt = trim('" + sym + "');" + Environment.NewLine; if (ex.Trim().ToLower() == "x") { txtQuery.Text += "select * from tx_sec_view where root_ticker = trim('" + sym + "');" + Environment.NewLine; txtQuery.Text += "select * from tx_res_view where root_ticker = trim('" + sym + "');" + Environment.NewLine; txtQuery.Text += "select * from tx_region_view where root_ticker = trim('" + sym + "');" + Environment.NewLine; } else { txtQuery.Text += "select * from t_sec_view where root__ticker = trim('" + sym + "');" + Environment.NewLine; txtQuery.Text += "select * from t_res_view where root__ticker = trim('" + sym + "');" + Environment.NewLine; txtQuery.Text += "select * from t_region_view where root__ticker = trim('" + sym + "');" + Environment.NewLine; } } if (chkDb.Checked) { if (this.db == null) { this.db = new SSIS.DashBoard(); } this.db.Hide(); SSIS.tsEntities alDb = new SSIS.tsEntities(); this.db.SetSymbol(sym, ex); this.db.Show(); } txtQuery.SelectionStart = 0; txtQuery.SelectionLength = txtQuery.Text.Length; chkSqlServer.Checked = true; chkSqlServer.CheckState = CheckState.Checked; btnExecuteQuery_Click(null, null); Debug.WriteLine(Webber.GetMStarOwnershipInfo(sym, ex)); }
public void SetSymbol(string sym, string ex) { SSIS.tsEntities alDb = new SSIS.tsEntities(); ar a = alDb.ars.Where(arr => arr.rt == sym && arr.ex == ex).FirstOrDefault(); pr pr = alDb.prs.Where(prr => prr.rt == sym && prr.ex == ex).FirstOrDefault(); if (a != null) { List <KeyValuePair <string, double> > data = new List <KeyValuePair <string, double> >(); data.Add(new KeyValuePair <string, double>("low", (a.lt.HasValue ? a.lt.Value : 0))); data.Add(new KeyValuePair <string, double>("med", (a.mdt.HasValue ? a.mdt.Value : 0))); data.Add(new KeyValuePair <string, double>("mean", (a.met.HasValue ? a.met.Value : 0))); data.Add(new KeyValuePair <string, double>("high", (a.ht.HasValue ? a.ht.Value : 0))); if (pr != null) { data.Add(new KeyValuePair <string, double>("cur", (pr.price.HasValue ? pr.price.Value : 0))); data.Add(new KeyValuePair <string, double>("52H", (pr.week_52_h.HasValue ? pr.week_52_h.Value : 0))); data.Add(new KeyValuePair <string, double>("52L", (pr.week_52_l.HasValue ? pr.week_52_l.Value : 0))); } this.dbeAr.SetData(data, "AR"); } per p = alDb.pers.Where(prr => prr.rt == sym && prr.ex == ex).FirstOrDefault(); if (p != null) { List <KeyValuePair <string, double> > data = new List <KeyValuePair <string, double> >(); data.Add(new KeyValuePair <string, double>("five", (p.five_day.HasValue ? p.five_day.Value : 0))); data.Add(new KeyValuePair <string, double>("OneM", (p.one_month.HasValue ? p.one_month.Value : 0))); data.Add(new KeyValuePair <string, double>("ThrM", (p.three_month.HasValue ? p.three_month.Value : 0))); data.Add(new KeyValuePair <string, double>("ytd", (p.ytd.HasValue ? p.ytd.Value : 0))); data.Add(new KeyValuePair <string, double>("oneY", (p.one_year.HasValue ? p.one_year.Value : 0))); this.dbePer.SetData(data, "Per"); } }