// GET: Stock/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.CompanyID = new SelectList(db.Companies, "ID", "TickerSymbol");
            StockCandlestick s = db.StockCandlesticks.Single(m => m.ID == id);

            return(View(s));
        }
 // GET: Stock/Delete/5
 public ActionResult Delete(int id)
 {
     try
     {
         StockCandlestick s = db.StockCandlesticks.Single(m => m.ID == id);
         db.StockCandlesticks.Remove(s);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(StockCandlestick s)
 {
     ViewBag.CompanyID = new SelectList(db.Companies, "ID", "TickerSymbol");
     try
     {
         s.Company = db.Companies.Find(s.CompanyId);
         db.StockCandlesticks.Add(s);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(int id, FormCollection collection)
 {
     ViewBag.CompanyID = new SelectList(db.Companies, "ID", "TickerSymbol");
     try
     {
         StockCandlestick s = db.StockCandlesticks.Single(m => m.ID == id);
         if (TryUpdateModel(s))
         {
             //TODO: database code
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(s));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         StockCandlestick s = db.StockCandlesticks.Single(m => m.ID == id);
         db.StockCandlesticks.Remove(s);
         if (TryUpdateModel(s))
         {
             //TODO: database code
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(s));
     }
     catch
     {
         return(View());
     }
 }