public ActionResult ShowStockFiles(string siteId, string stockId)
 {
     StockDetails stockDetails = new StockDetails();
     var manager = new StockManager();
     stockDetails.lstStockFilesViewModel = manager.GetAllStockFiles(siteId, stockId);
     return Json(stockDetails.lstStockFilesViewModel, JsonRequestBehavior.AllowGet);
 }
Пример #2
0
 public void RemoveAllStockFiles()
 {
     var manager = new StockManager();
     manager.ExtractStockFilesFromSites();
     bool isDeleted = manager.RemoveAllStockFiles();
     Assert.IsTrue(isDeleted);
 }
Пример #3
0
 public void GetStockFile()
 {
     var manager = new StockManager();
     manager.ExtractStockFilesFromSites();
     var lstSstockFiles = manager.GetAllStockFiles();
     Assert.IsTrue(lstSstockFiles.Count > 0 && manager.GetStockFile(lstSstockFiles[0].Id.ToString()) != null);
 }
 // GET: StockDetails
 public ActionResult Index()
 {
     StockDetails stockDetails = new StockDetails();
     var manager = new StockManager();
     stockDetails.Sites = manager.GetAllSites();
     stockDetails.Symbols = manager.GetSymbols();
     return View(stockDetails);
 }
        public ActionResult ViewFiles(string stockFileId)
        {
            var manager = new StockManager();
            StockDetails stockDetails = new StockDetails();
            stockDetails.StockFilesViewModel = manager.GetStockFile(stockFileId);

            byte[] byteArray = Encoding.UTF8.GetBytes(stockDetails.StockFilesViewModel.File);
            FileTypeFactory fileFactory = new FileTypeFactory();
            FileType fileTypeClass = fileFactory.FileTypes(stockDetails.StockFilesViewModel.Format.ToLower());
            string fileType = fileTypeClass.GetFileType();
            return File(byteArray, fileType);
        }
Пример #6
0
 public void GetSymbols()
 {
     var manager = new StockManager();
     var symbols = manager.GetSymbols();
     Assert.IsTrue(symbols.Count > 0);
 }
Пример #7
0
 public void GetAllStockFilesFromCriteria()
 {
     var manager = new StockManager();
     var lststockFiles = manager.GetAllStockFiles("1", "1");
     Assert.IsTrue(lststockFiles != null);
 }
Пример #8
0
 public void GetAllStockFiles()
 {
     var manager = new StockManager();
     var lststockFiles = manager.GetAllStockFiles();
     Assert.IsTrue(lststockFiles != null);
 }
Пример #9
0
 public void GetAllSites()
 {
     var manager = new StockManager();
     var sites = manager.GetAllSites();
     Assert.IsTrue(sites.Count > 0);
 }
 public void RemoveAllStockFiles()
 {
     var manager = new StockManager();
     manager.RemoveAllStockFiles();
 }
 public void GenerateStockFiles()
 {
     var manager = new StockManager();
     manager.ExtractStockFilesFromSites();
 }