public ActionResult ChangeCase(cCase Case, 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(Case.id).Quantity; } if (image != null && image != "") { part.Image = image; } else { part.Image = sr.getPart(Case.id).image; } bool done = sr.EditCase(Case, part, Case.id); if (done) { return(this.Redirect(Url.Action("Complete", "EditProduct"))); } else { return(this.Redirect(Url.Action("Case", "EditProduct"))); } }
public ActionResult Case(int id) { CRUDService.ServiceClient sr = new CRUDService.ServiceClient(); cCase part = sr.getCase(id); return(View(part)); }
public ActionResult Case() { if (Convert.ToInt32(Session["UserType"]) != 1 && Convert.ToInt32(Session["UserType"]) != 3) { return(this.Redirect(@Url.Action("Index", "Home"))); } cCase Case = new cCase { active = 0 }; return(View(Case)); }
public ActionResult addCase(cCase Case, 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.addCase(Case, 1, image); if (added) { return(this.Redirect(Url.Action("Complete", "AddNewProduct"))); } else { return(this.Redirect(Url.Action("Case", "AddNewProduct"))); } }