public async Task <IHttpActionResult> PutPageNodes(int id, PageNodes pageNodes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pageNodes.Id) { return(BadRequest()); } db.Entry(pageNodes).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PageNodesExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "ProductsModelId,Nume,CodProdus,DescriereProdus,GreutateProdus,Pret,Producator,Categorie,IsActiv,MetaTitle,MetaKeywords,MetaDescription,Url")] ProductsModel productsModel) { if (ModelState.IsValid) { db.Entry(productsModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(productsModel)); }
public ActionResult Edit([Bind(Include = "CategoriesModelId,Nume,Titlu,Descriere,ParentId,Order,MetaTitle,MetaKeywords,MetaDescription,Url")] CategoriesModel categoriesModel) { if (ModelState.IsValid) { db.Entry(categoriesModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(categoriesModel)); }