示例#1
0
        public ActionResult Index(InputData vm)
        {
            try
            {
                ClsOperate COP = new ClsOperate();
                COP.Para1 = vm.strStockCode;
                COP.Para2 = vm.strDataDate;
                COP.Para3 = vm.strEndDate;

                if (vm.YearCnt > 24)
                {
                    return View("OverCount");
                }

                COP.WDT = ClsOperate.WebDataType.Individual;
                COP.Main_Batch();

               


                ViewData["StockCode"] = vm.strStockCode;
                ViewData["StartDate"] = vm.strDataDate;
                ViewData["LiStockIndi"] = COP.OutputList;
                ExportClientsListToCSV(COP.OutputList);
                return View(vm);
            }
            catch 
            {
                return View("Error");
            }
            

        }
示例#2
0
        public ActionResult showdata(InputData vm) 
        {
            //ViewData["strStockCode"] = vm.strStockCode;
            //ViewData["strDataDate"] = vm.strDataDate;
            //ViewData["strEndDate"] = vm.strEndDate;
            string Ax;
            Ax="[";

            try
            {
                ClsOperate COP = new ClsOperate();
                COP.Para1 = vm.strStockCode;
                COP.Para2 = vm.strDataDate;
                COP.Para3 = vm.strEndDate;

                if (vm.YearCnt > 24)
                {
                    //return View("OverCount");
                }

                COP.WDT = ClsOperate.WebDataType.Individual;
                COP.Main_Batch();

                ViewData["StockCode"] = vm.strStockCode;
                ViewData["StartDate"] = vm.strDataDate;
                ViewData["LiStockIndi"] = COP.OutputList;

                int x = 1;
                foreach (var line in COP.OutputList) 
                {
                    var buildjsonResult = new
                    {
                        TxnDate=line.TxnDate,
                        DealStockAmt=line.DealStockAmt,
                        OpenPrice=line.OpenPrice,
                        HighPrice = line.HighPrice,
                        LowPrice = line.LowPrice,
                        ClosePrice = line.ClosePrice
                    };
                    //Response.Write(JsonConvert.SerializeObject(buildjsonResult);
                    //Ax = Ax + line.TxnDate + "," + line.DealStockCnt + "," + line.DealStockAmt + "," + line.OpenPrice + "," + line.HighPrice + "," + line.LowPrice + "," + line.ClosePrice + "," + line.PriceDiff + "," + line.DealCount + Server.HtmlDecode("<br/>");
                    Ax = Ax + JsonConvert.SerializeObject(buildjsonResult);
                    x += 1;
                    if (x <= COP.OutputList.Count) 
                    {
                        Ax = Ax + ",";
                    }
                    
                }

                Ax = Ax + "]";
                ViewData["Ax"] = Ax;
                return View(vm);
            }
            catch
            {
                return View("Error");
            }
        }