public void LoadSecurityData(OpenPositionItem monitorItem)
        {
            int bmkCopies    = 1;
            var templateItem = _templateBLL.GetTemplate(monitorItem.TemplateId);

            if (templateItem != null)
            {
                bmkCopies = templateItem.FutureCopies;
                //Load the future
                OpenPositionSecurityItem futureItem = new OpenPositionSecurityItem
                {
                    Selection     = true,
                    MonitorId     = monitorItem.MonitorId,
                    MonitorName   = monitorItem.MonitorName,
                    SecuCode      = monitorItem.FuturesContract,
                    SecuName      = monitorItem.FuturesContract,
                    WeightAmount  = templateItem.FutureCopies,
                    EntrustAmount = monitorItem.Copies * templateItem.FutureCopies,
                    EDirection    = EntrustDirection.SellOpen,
                    SecuType      = SecurityType.Futures
                };

                _securityDataSource.Add(futureItem);
            }

            List <TemplateStock>            stocks    = _templateBLL.GetStocks(monitorItem.TemplateId);
            List <OpenPositionSecurityItem> secuItems = new List <OpenPositionSecurityItem>();

            int actualCopies = bmkCopies * monitorItem.Copies;

            foreach (var stock in stocks)
            {
                OpenPositionSecurityItem secuItem = new OpenPositionSecurityItem
                {
                    Selection     = true,
                    MonitorId     = monitorItem.MonitorId,
                    MonitorName   = monitorItem.MonitorName,
                    SecuCode      = stock.SecuCode,
                    SecuName      = stock.SecuName,
                    WeightAmount  = stock.Amount,
                    EntrustAmount = actualCopies * stock.Amount,
                    EDirection    = EntrustDirection.BuySpot,
                    SecuType      = SecurityType.Stock
                };

                _securityDataSource.Add(secuItem);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 增高页面
 /// </summary>
 /// <param name="d"></param>
 /// <param name="nd"></param>
 /// <returns></returns>
 public ActionResult zg(string d, string nd)
 {
     //CommonViewAreasByTemplateName(d, nd, "zg.txt", true);
     //CommonViewAreasByTemplateName(d, nd, "zg1.txt", false);
     //CommonView(d, nd);
     ViewBag.TemplateConntent = TemplateBLL.GetTemplate(DN.WeiAd.Business.Config.AppConfig.TemplatePath);
     return(View());
 }
Beispiel #3
0
        /// <summary>
        /// 获取加密模版文件
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public string GetTemplateByNameEncode(string filename)
        {
            string filepath = Server.MapPath(string.Format("/Resources/Template/{0}", filename));
            string html     = "";

            html = TemplateBLL.GetTemplate(filepath);

            return(html);
        }
Beispiel #4
0
        /// <summary>
        /// 增高
        /// </summary>
        /// <param name="d"></param>
        /// <param name="nd"></param>
        /// <returns></returns>
        public ActionResult zg(string d, string nd)
        {
            //CommonView(d, nd);

            //skey edit 2017-11-20
            string html = TemplateBLL.GetTemplate(DN.WeiAd.Business.Config.AppConfig.TemplatePathDynamic);

            if (!string.IsNullOrEmpty(d))
            {
                var adinfo = AdPageInfoBLL.Instance.GetModelById(int.Parse(d));
                if (adinfo != null)
                {
                    html = html.Replace("@ViewBag.QcodeImg2", adinfo.QcodeImg2);
                }
            }

            ViewBag.TemplateConntent = html;

            return(View());
        }