예제 #1
0
        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));
        }
예제 #2
0
 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));
 }
예제 #3
0
 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));
 }