示例#1
0
        private List <UICommandSecurityItem> GenerateTestCommandSecurity()
        {
            List <UICommandSecurityItem> csItems = new List <UICommandSecurityItem>();

            UICommandSecurityItem item1 = new UICommandSecurityItem
            {
                Selected          = 0,
                SecurityCode      = "000002",
                SecurityName      = "万科A",
                CommandNo         = 23,
                FundCode          = "FO11123",
                PortfolioName     = "Test",
                CommandPrice      = 12.23,
                CommandAmount     = 12345,
                EntrustDirection  = "Buy",
                EntrustedAmount   = 1200,
                PriceType         = "B1",
                EntrustedPrice    = 12.20,
                ThisEntrustAmount = 120,
                DealAmount        = 200,
                TargetAmount      = 250,
                WaitAmount        = 50,
                SuspensionFlag    = "Up",
                TargetCopies      = 5,
                LimitUpPrice      = 15.0,
                LimitDownPrice    = 10.5,
                LimitUpOrDown     = "Up"
            };
            UICommandSecurityItem item2 = new UICommandSecurityItem
            {
                Selected          = 0,
                SecurityCode      = "000001",
                SecurityName      = "中国平安",
                CommandNo         = 23,
                FundCode          = "FO11123",
                PortfolioName     = "Test",
                CommandPrice      = 12.23,
                CommandAmount     = 12345,
                EntrustDirection  = "Buy",
                EntrustedAmount   = 1200,
                PriceType         = "B1",
                EntrustedPrice    = 12.20,
                ThisEntrustAmount = 120,
                DealAmount        = 200,
                TargetAmount      = 250,
                WaitAmount        = 50,
                SuspensionFlag    = "Up",
                TargetCopies      = 5,
                LimitUpPrice      = 15.0,
                LimitDownPrice    = 10.5,
                LimitUpOrDown     = "Up"
            };

            csItems.Add(item1);
            csItems.Add(item2);

            return(csItems);
        }
示例#2
0
        private List <UICommandSecurityItem> GetSelectionCommandSecurityItems()
        {
            List <UICommandSecurityItem> selectionItems = new List <UICommandSecurityItem>();
            var dgv = dataGridViewCmdTrading;

            try
            {
                foreach (DataGridViewRow row in dgv.Rows)
                {
                    UICommandSecurityItem item = new UICommandSecurityItem();
                    item.CommandNo         = (int)row.Cells["tc_commandno"].Value;
                    item.SecurityCode      = (string)row.Cells["cs_secucode"].Value;
                    item.SecurityName      = (string)row.Cells["cs_secuname"].Value;
                    item.CommandNo         = (int)row.Cells["cs_commandno"].Value;
                    item.FundCode          = (string)row.Cells["cs_fundcode"].Value;
                    item.PortfolioName     = (string)row.Cells["cs_portfolioname"].Value;
                    item.CommandPrice      = (double)row.Cells["cs_commandprice"].Value;
                    item.CommandAmount     = (int)row.Cells["cs_commandamount"].Value;
                    item.EntrustDirection  = (string)row.Cells["cs_entrustdirection"].Value;
                    item.EntrustedAmount   = (int)row.Cells["cs_entrustedamount"].Value;
                    item.PriceType         = (string)row.Cells["cs_pricetype"].Value;
                    item.EntrustedPrice    = (double)row.Cells["cs_entrustprice"].Value;
                    item.ThisEntrustAmount = (int)row.Cells["cs_thisentrustamout"].Value;
                    item.DealAmount        = (int)row.Cells["cs_dealamount"].Value;
                    item.TargetAmount      = (int)row.Cells["cs_targetamount"].Value;
                    item.WaitAmount        = (int)row.Cells["cs_waitamount"].Value;
                    item.SuspensionFlag    = (string)row.Cells["cs_suspensionflag"].Value;
                    item.TargetCopies      = (int)row.Cells["cs_targetcopies"].Value;
                    item.CommandCopies     = (int)row.Cells["cs_commandcopies"].Value;
                    item.LimitUpPrice      = (double)row.Cells["cs_limitupprice"].Value;
                    item.LimitDownPrice    = (double)row.Cells["cs_limitdownprice"].Value;
                    item.LimitUpOrDown     = (string)row.Cells["cs_limitupdown"].Value;

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

            return(selectionItems);
        }