示例#1
0
        public ActionResult CreateSymbol(StockSymbol type)
        {
            type.MarketId = Int16.Parse(this.Request.Form.Get("MarketList"));
            if (ModelState.IsValid)
            {
                Company company = db.Companies.Find(type.CompanyId);
                company.Revision++;
                db.Entry(company).State = EntityState.Modified;
                db.StockSymbols.Add(type);
                db.SaveChanges();
                //To-Do add the sync for the individual stock ...

                return RedirectToAction("Details", new { id = type.CompanyId });
            }

            return View(type);
        }
示例#2
0
 public ActionResult CreateSymbol(int companyid = 0)
 {
     Company company = db.Companies.Find(companyid);
     if (company == null)
         HttpNotFound();
     StockSymbol type = new StockSymbol();
     type.CompanyId = companyid;
     ViewBag.MarketList = new SelectList(db.Markets.ToList(), "MarketId", "MarketName");
     return View(type);
 }