public ActionResult ChangeGPU(cGPU gpu, int?quantity, string image) { CRUDService.ServiceClient sr = new CRUDService.ServiceClient(); PartsStock part = new PartsStock(); if (quantity != null) { part.Quantity = (int)quantity; } else { part.Quantity = sr.getPart(gpu.id).Quantity; } if (image != null && image != "") { part.Image = image; } else { part.Image = sr.getPart(gpu.id).image; } bool done = sr.EditGPU(gpu, part, gpu.id); if (done) { return(this.Redirect(Url.Action("Complete", "EditProduct"))); } else { return(this.Redirect(Url.Action("GPU", "EditProduct"))); } }
public ActionResult GPU(int id) { CRUDService.ServiceClient sr = new CRUDService.ServiceClient(); cGPU gpu = sr.getGPU(id); return(View(gpu)); }
public ActionResult GPU() { if (Convert.ToInt32(Session["UserType"]) != 1 && Convert.ToInt32(Session["UserType"]) != 3) { return(this.Redirect(@Url.Action("Index", "Home"))); } cGPU gpu = new cGPU { active = 0 }; return(View(gpu)); }
public ActionResult addGPU(cGPU gpu, decimal price, string image) { if (Convert.ToInt32(Session["UserType"]) != 1 && Convert.ToInt32(Session["UserType"]) != 3) { return(this.Redirect(@Url.Action("Index", "Home"))); } CRUDService.ServiceClient sr = new CRUDService.ServiceClient(); bool added = sr.addGPU(gpu, 1, price, image); if (added) { return(this.Redirect(Url.Action("Complete", "AddNewProduct"))); } else { return(this.Redirect(Url.Action("GPU", "AddNewProduct"))); } }