public ActionResult AddMotherboard() { var rp = new MotherboardRepo(new MotherboardMssql()); var cvm = new MotherboardViewModel((Computer)Session["CurrentBuild"], rp.GetAll()); return(View(cvm)); }
public ActionResult Motherboard(int computerId) { var cr = new ComputerRepo(new ComputerMssql()); var mb = new MotherboardRepo(new MotherboardMssql()); var mvm = new MotherboardViewModel(cr.GetById(computerId), mb.GetAll()); return(View(mvm)); }
public ActionResult AddMotherboard(int motherboardId) { var rp = new MotherboardRepo(new MotherboardMssql()); var pc = (Computer)Session["CurrentBuild"]; pc.Motherboard = rp.GetById(motherboardId); Session["CurrentBuild"] = pc; return(RedirectToAction("NewBuild", "Build")); }
public ActionResult EditMotherBoard(int computerId, int motherboardId) { var cr = new ComputerRepo(new ComputerMssql()); var mb = new MotherboardRepo(new MotherboardMssql()); var editedPc = cr.GetById(computerId); editedPc.Motherboard = mb.GetById(motherboardId); cr.Update(editedPc); return(RedirectToAction("EditBuild", "Build", new { computerId })); }