示例#1
0
        private List <UITradingCommandItem> GetSelectionCommandTradingItems()
        {
            List <UITradingCommandItem> selectionItems = new List <UITradingCommandItem>();
            var dgv = dataGridViewCmdTrading;

            try
            {
                foreach (DataGridViewRow row in dgv.Rows)
                {
                    UITradingCommandItem item = new UITradingCommandItem();
                    item.CommandNo       = (int)row.Cells["tc_commandno"].Value;
                    item.CommandType     = (string)row.Cells["tc_commandtype"].Value;
                    item.ExecuteType     = (string)row.Cells["tc_executetype"].Value;
                    item.CommandNum      = (int)row.Cells["tc_commandnum"].Value;
                    item.TargetNum       = (int)row.Cells["tc_targetnum"].Value;
                    item.BaisPrice       = (double)row.Cells["tc_baisprice"].Value;
                    item.LongMoreThan    = (double)row.Cells["tc_longmorethan"].Value;
                    item.BearMoreThan    = (double)row.Cells["tc_bearmorethan"].Value;
                    item.LongRatio       = (double)row.Cells["tc_longratio"].Value;
                    item.BearRatio       = (double)row.Cells["tc_bearratio"].Value;
                    item.CommandAmount   = (int)row.Cells["tc_commandamount"].Value;
                    item.EntrustedAmount = (int)row.Cells["tc_entrustedamount"].Value;
                    item.DealAmount      = (int)row.Cells["tc_dealamount"].Value;
                    item.CommandMoney    = (double)row.Cells["tc_commandmoney"].Value;
                    item.Exposure        = (double)row.Cells["tc_exposure"].Value;
                    item.StartDate       = (string)row.Cells["tc_startdate"].Value;
                    item.EndDate         = (string)row.Cells["tc_enddate"].Value;
                    item.StartTime       = (string)row.Cells["tc_starttime"].Value;
                    item.EndTime         = (string)row.Cells["tc_endtime"].Value;
                    item.DispatchTime    = (string)row.Cells["tc_dispatchtime"].Value;
                    item.ExecutePerson   = (string)row.Cells["tc_executeperson"].Value;
                    item.DispatchPerson  = (string)row.Cells["tc_dispatchperson"].Value;
                    item.InstanceId      = (string)row.Cells["tc_instanceid"].Value;
                    item.InstanceNo      = (string)row.Cells["tc_instanceno"].Value;
                    item.MonitorUnit     = (string)row.Cells["tc_monitorunit"].Value;

                    selectionItems.Add(item);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            return(selectionItems);
        }
示例#2
0
        private List <UITradingCommandItem> GenerateTestCommandTrading()
        {
            List <UITradingCommandItem> tcItems = new List <UITradingCommandItem>();
            UITradingCommandItem        item1   = new UITradingCommandItem
            {
                Selected        = 1,
                CommandNo       = 12,
                CommandType     = "Test",
                ExecuteType     = "Buy",
                CommandNum      = 100,
                TargetNum       = 150,
                BaisPrice       = 0.25,
                LongMoreThan    = 0.35,
                BearMoreThan    = 0.25,
                LongRatio       = 0.35,
                BearRatio       = 0.12,
                CommandAmount   = 130,
                EntrustedAmount = 120,
                CommandMoney    = 154014.00,
                Exposure        = 12.0,
                StartDate       = "20160321",
                EndDate         = "20160321",
                StartTime       = "134200",
                EndTime         = "134500",
                DispatchTime    = "134311",
                ExecutePerson   = "Magast",
                DispatchPerson  = "Youyo",
                InstanceId      = "1120",
                InstanceNo      = "A110",
                MonitorUnit     = "M10"
            };

            tcItems.Add(item1);

            UITradingCommandItem item2 = new UITradingCommandItem
            {
                Selected        = 1,
                CommandNo       = 20,
                CommandType     = "Test",
                ExecuteType     = "Buy",
                CommandNum      = 100,
                TargetNum       = 150,
                BaisPrice       = 0.25,
                LongMoreThan    = 0.35,
                BearMoreThan    = 0.25,
                LongRatio       = 0.35,
                BearRatio       = 0.12,
                CommandAmount   = 130,
                EntrustedAmount = 120,
                CommandMoney    = 154014.00,
                Exposure        = 12.0,
                StartDate       = "20160321",
                EndDate         = "20160321",
                StartTime       = "134200",
                EndTime         = "134500",
                DispatchTime    = "134311",
                ExecutePerson   = "Magast",
                DispatchPerson  = "Youyo",
                InstanceId      = "1120",
                InstanceNo      = "A110",
                MonitorUnit     = "M10"
            };

            tcItems.Add(item2);

            return(tcItems);
        }