/// <summary> /// Stores all Symbols in ViewData["symbols"], /// all symbols with symboltype other than normal in ViewDate["types"], /// and all CompositeSymbols in ViewData["comp"], /// and returns the index-view of WriteController. /// </summary> /// <returns>~/Write/Inex.cshtml</returns> public ActionResult Index() { SymbolBLL symbols = new SymbolBLL(); ViewData["symbols"] = symbols.GetAllSymbols(); SymbolTypeBLL types = new SymbolTypeBLL(); ViewData["types"] = types.GetAllNonStandard(); CompositeSymbolBLL comp = new CompositeSymbolBLL(); ViewData["comp"] = comp.GetAll(); CompositeOfBLL compOf = new CompositeOfBLL(); ViewData["compOf"] = compOf.getAllRelations(); return View(); }
/// <summary> /// Gets the id of the CompositeSymbol you want to edit, /// the symbols it is made of, and a list of all Symbols, /// saves them in ViewData and then returns the Edit-view. /// </summary> /// <param name="id"></param> /// <returns>Edit-view</returns> public ActionResult Edit(int id) { if (Session["logged_in"] == null) return RedirectToAction("Index", "Index"); CompositeSymbolBLL comp = new CompositeSymbolBLL(); CompositeSymbol find = comp.GetExaxtComositeSymbolByID(id); CompositeOfBLL compOf = new CompositeOfBLL(); SymbolBLL symb = new SymbolBLL(); List<Symbol> symbols = compOf.GetComponentsOf(find); SymbolTypeBLL types = new SymbolTypeBLL(); ViewData["comp"] = find; ViewData["symbList"] = symbols; ViewData["otherSymbols"] = symb.GetAllSymbols(); ViewData["Types"] = types.GetAllNonStandard(); return View(); }
/// <summary> /// Returns the index-view together with a list of all symbols /// stored in ViewData["symb"], and a message if it exists. /// </summary> /// <returns>~/Symbol/Index.cshtml</returns> public ActionResult Index() { SymbolBLL symb = new SymbolBLL(); SymbolTypeBLL types = new SymbolTypeBLL(); ViewData["types"] = types.GetAllNonStandard(); ViewData["symb"] = symb.GetAllSymbols(); if (TempData["msg"] != null) { ViewBag.Message = TempData["msg"].ToString(); } return View(); }
/// <summary> /// Takes int id as parameter and finds the corresponding RawSymbolImport. /// Saves the RawSymbolImport and a list of all Symbols in Viewdata["raw"] and /// Viewdata["symbList"] respectively, and returns the ConvertToComposite-view. /// </summary> /// <param name="id"></param> /// <returns>~/RawList/ConvertToComposite.cshtml</returns> public ActionResult ConvertToComposite(int id) { if (Session["logged_in"] == null) return RedirectToAction("Index", "Index"); RawSymbolImportBLL raw = new RawSymbolImportBLL(); RawSymbolImport find = raw.GetExact(id); SymbolBLL symb = new SymbolBLL(); SymbolTypeBLL types = new SymbolTypeBLL(); ViewData["raw"] = find; ViewData["symbList"] = symb.GetAllSymbols(); ViewData["types"] = types.GetAllNonStandard(); return View(); }