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));
        }
Example #3
0
        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"));
        }
Example #4
0
        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 }));
        }