예제 #1
0
        public ActionResult AddMotherboard()
        {
            var rp  = new MotherboardRepo(new MotherboardMssql());
            var cvm = new MotherboardViewModel((Computer)Session["CurrentBuild"], rp.GetAll());

            return(View(cvm));
        }
예제 #2
0
        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));
        }
예제 #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"));
        }
예제 #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 }));
        }