private void button2_Click(object sender, EventArgs e) { tt buy = new tt(); buy = getbuylist(Buycode.Text, double.Parse(listView1.Items[5].SubItems[1].Text), double.Parse(tlje.Text)); tt sell = new tt(); sell = getselllist(Sellcode.Text, double.Parse(listView2.Items[5].SubItems[1].Text), double.Parse(tlje.Text)); if (buy.direction == null || sell.direction == null) { MessageBox.Show("输入代码有误"); } else { Buyprice.Text = listView1.Items[5].SubItems[1].Text; Sellprice.Text = listView2.Items[5].SubItems[1].Text; jktime.Text = Convert.ToDateTime(systemtime.Text).ToLongTimeString(); listView3.Items.Clear(); Buyamount.Text = buy.amount.ToString(); Sellamount.Text = sell.amount.ToString(); play(buy); play(sell); double t = getsum(); Total.Text = t.ToString(); if (t >= 0) { Total.ForeColor = Color.Red; } else { Total.ForeColor = Color.Green; } } }
public static void zhiBiaoFu() { tt t1 = tt.grem; tt t2 = tt.dre; Console.WriteLine("{0}, \t{1}", t1, (int)t1); Console.WriteLine("{0}, \t{1}", t2, (int)t2); Console.ReadKey(); }
public IActionResult Index() { testViewModel m = new testViewModel(); List <tt> tlist = new List <tt>(); for (int i = 0; i < 10; i++) { tt t = new tt(); t.link = "/test2/index/" + i; t.userid = i.ToString(); tlist.Add(t); } m.data = tlist; return(View(m)); }
public void test(tt mt) { //Console.WriteLine(string.Format("step 1:{0}", index)); lock (this) { while (mt.index > 10) { Console.WriteLine(string.Format("step 2:{0} Name={1}", mt.index, name)); mt.index--; test(mt); } } }
public tt getselllist(string code, double price, double sum) { tt t = new tt(); Sina con = new Sina(); List <StockInfo> now = new List <StockInfo>(); now = con.GetCurrent(code); if (now[0].Name == null) { t.direction = null; return(t); } t.price = price; t.code = code; t.name = now[0].Name; t.direction = "卖出"; t.current = now[0].Current; t.amount = (int)Math.Ceiling(sum / 200 / price) * 100; t.profit = t.amount * price * (1 - double.Parse(yjfl.Text) - double.Parse(yhsl.Text) - double.Parse(rqlx.Text) * int.Parse(rqday.Text) / 365) - t.amount * t.current * (1 + double.Parse(yjfl.Text)); return(t); }
private void TimedEvent(object source, ElapsedEventArgs e)//刷新定时器 { if (listView1.Items.Count > 0) { int t = show(this.listView1, Buycode.Text, 1); } if (listView2.Items.Count > 0) { int t = show(this.listView2, Sellcode.Text, 2); } if (listView3.Items.Count > 0) { tt buy = new tt(); buy = getbuylist(listView3.Items[0].SubItems[1].Text, double.Parse(listView3.Items[0].SubItems[4].Text), double.Parse(tlje.Text)); tt sell = new tt(); sell = getselllist(listView3.Items[1].SubItems[1].Text, double.Parse(listView3.Items[1].SubItems[4].Text), double.Parse(tlje.Text)); if (buy.direction != null && sell.direction != null) { listView3.Items.Clear(); Buyamount.Text = buy.amount.ToString(); Sellamount.Text = sell.amount.ToString(); play(buy); play(sell); double t = getsum(); Total.Text = t.ToString(); if (t >= 0) { Total.ForeColor = Color.Red; } else { Total.ForeColor = Color.Green; } } } }
public void play(tt temp) { ListViewItem items; items = new ListViewItem(temp.direction); items.SubItems.Add(temp.code); items.SubItems.Add(temp.name); items.SubItems.Add(temp.amount.ToString()); items.SubItems.Add(temp.price.ToString()); double t = temp.price * temp.amount; items.SubItems.Add(t.ToString()); items.SubItems.Add(temp.current.ToString()); items.SubItems.Add(temp.profit.ToString("f2"));; if (temp.profit < 0) { items.ForeColor = Color.Green; } else { items.ForeColor = Color.Red; } this.listView3.Items.Add(items); }
public IEnumerable <FactorsCredential> ListVerifiedAccounts <tt>() where tt : IFactorsFeatureType, new() { var featureType = new tt(); return(Configuration.StorageDatabase.ListCredentialsFor(UserAccount, featureType, FactorsCredentialListQueryType.VerifiedAccounts)); }
public Task <IEnumerable <FactorsCredential> > ListAllAccountsAsync <tt>() where tt : IFactorsFeatureType, new() { var featureType = new tt(); return(Configuration.StorageDatabase.ListCredentialsForAsync(UserAccount, featureType, FactorsCredentialListQueryType.AllAccount)); }
public void onMessagesDelegate(string s, tt t) { MetaPackTrace.Info(string.Format("[SharePointPnP] - {0}", s)); }
private void button4_Click(object sender, EventArgs e) { tt bg = new tt() { "iii", "ouu" }; bg.T = "9999"; bg.GetCache().Init(); bg.Save(); tt bg2 = new tt(); bg2.T = "4444"; // string fr = bg.GetCache().ToSerializableString(); // bg2.GetCache().FromSerializableString(fr); bg2.LoadData(); }