public ActionResult Gpu(int computerId, int selectedGpu) { var cr = new ComputerRepo(new ComputerMssql()); var gr = new GpuRepo(new GpuMssql()); var gvm = new GpuViewModel(cr.GetById(computerId), gr.GetAll(), selectedGpu); return(View(gvm)); }
public ActionResult Memory(int computerId) { var cr = new ComputerRepo(new ComputerMssql()); var mr = new MemoryRepo(new MemoryMssql()); var mvm = new MemoryViewModel(cr.GetById(computerId), mr.GetAll()); return(View(mvm)); }
public ActionResult Storage(int computerId) { var cr = new ComputerRepo(new ComputerMssql()); var mr = new StorageRepo(new StorageMssql()); var svm = new StorageViewModel(cr.GetById(computerId), mr.GetAll()); return(View(svm)); }
// GET: Part public ActionResult Cpu(int computerId) { var cr = new ComputerRepo(new ComputerMssql()); var cp = new CpuRepo(new CpuMssql()); var cvm = new CpuViewModel(cr.GetById(computerId), cp.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 EditStorage(int computerId, int storageId) { var cr = new ComputerRepo(new ComputerMssql()); var sr = new StorageRepo(new StorageMssql()); var editedPc = cr.GetById(computerId); editedPc.Storage = sr.GetById(storageId); cr.Update(editedPc); return(RedirectToAction("EditBuild", "Build", new { computerId })); }
public ActionResult EditMemory(int computerId, int memoryId) { var cr = new ComputerRepo(new ComputerMssql()); var mr = new MemoryRepo(new MemoryMssql()); var editedPc = cr.GetById(computerId); editedPc.Memory = mr.GetById(memoryId); cr.Update(editedPc); return(RedirectToAction("EditBuild", "Build", new { computerId })); }
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 })); }
public ActionResult EditCpu(int computerId, int cpuId) { var cr = new ComputerRepo(new ComputerMssql()); var cp = new CpuRepo(new CpuMssql()); var editedPc = cr.GetById(computerId); editedPc.Cpu = cp.GetById(cpuId); cr.Update(editedPc); return(RedirectToAction("EditBuild", "Build", new { computerId })); }
//constructor public User(string username, string password, string email, List <int> computers) { Computers = new List <Computer>(); var cr = new ComputerRepo(new ComputerMssql()); Username = username; Password = password; Email = email; foreach (var x in computers) { Computers.Add(cr.GetById(x)); } }
public ActionResult EditGpu(int computerId, int gpuId, int currentGpu) { var cr = new ComputerRepo(new ComputerMssql()); var gr = new GpuRepo(new GpuMssql()); var editedPc = cr.GetById(computerId); for (var i = 0; i < editedPc.Gpus.Count; i++) { if (editedPc.Gpus[i].GpuId == currentGpu) { editedPc.Gpus[i] = gr.GetById(gpuId); } } cr.Update(editedPc); return(RedirectToAction("EditBuild", "Build", new { computerId })); }
public ActionResult EditBuild(int computerId) { var computer = new ComputerRepo(new ComputerMssql()); return(View(computer.GetById(computerId))); }