public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Web,Headquarters,Phone")] Store store) { if (ModelState.IsValid) { db.Entry(store).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(store)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,CategoryId")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", "Parent.Name", product.CategoryId); return(View(product)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,MeasurementUnit,DataType,CategoryId")] AttributeKey attributeKey) { if (ModelState.IsValid) { db.Entry(attributeKey).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", attributeKey.CategoryId); return(View(attributeKey)); }
public async Task <ActionResult> Edit([Bind(Include = "ProductId,AttributeKeyId,Value")] AttributeValue attributeValue) { if (ModelState.IsValid) { db.Entry(attributeValue).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.AttributeKeyId = new SelectList(db.AttributeKeys, "Id", "Name", attributeValue.AttributeKeyId); ViewBag.ProductId = new SelectList(db.Products, "Id", "Name", attributeValue.ProductId); return(View(attributeValue)); }
public async Task <ActionResult> Edit([Bind(Include = "ProductId,StoreId,Price")] Inventory inventory) { if (ModelState.IsValid) { db.Entry(inventory).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.ProductId = new SelectList(db.Products.OrderBy(x => x.Name), "Id", "Name", "Category.Name", inventory.ProductId); ViewBag.StoreId = new SelectList(db.Stores, "Id", "Name", inventory.StoreId); return(View(inventory)); }