예제 #1
0
        private void timer_Tick(object sender, EventArgs e)
        {
            active_event = hub.GetEventInfo(EID);
            float val = (float)active_event.kursy[CID];

            PushValue(val);
            this.GraphBox.Refresh();
        }
예제 #2
0
        public EventInfo GetEventInfo(int eid)
        {
            string sql = "SELECT * FROM wydarzenie WHERE kodwyd=" + eid + ";";
            DataTable dt = sqlg.ExecuteQuery(sql);

            EventInfo ei = new EventInfo();
            ei.name = (string)dt.Rows[0]["nazwawyd"];
            ei.eid = eid;
            ei.ryzyko = Import(dt.Rows[0]["ryzyko"]);

            sql = "SELECT * FROM rynek WHERE kodwyd=" + eid + ";";
            dt = sqlg.ExecuteQuery(sql);
            ei.N = dt.Rows.Count;

            ei.wyns = new string[ei.N];
            ei.stawki = new int[ei.N];

            for (int i = 0; i < ei.N; i++)
            {
                ei.wyns[i] = (string)dt.Rows[i]["nazwawyn"];
                ei.stawki[i] = Import(dt.Rows[i]["stawka"]);
            }
            ei.kursy = Courses(eid);

            return ei;
        }