public async Task <IActionResult> Edit(string id, [Bind("Id,IdFood,IdResturant,Available")] ResturantsFood resturantsFood) { if (id != resturantsFood.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(resturantsFood); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResturantsFoodExists(resturantsFood.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdFood"] = new SelectList(_context.Tblfoods, "Id", "Id", resturantsFood.IdFood); ViewData["IdResturant"] = new SelectList(_context.Tblresturants, "Id", "Id", resturantsFood.IdResturant); return(View(resturantsFood)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,IdOrder,IdCustomer,OrderTime,RequestTime,Count")] Tblorder tblorder) { if (id != tblorder.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblorder); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblorderExists(tblorder.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdCustomer"] = new SelectList(_context.AspNetUsers, "Id", "Id", tblorder.IdCustomer); ViewData["IdOrder"] = new SelectList(_context.ResturantsFoods, "Id", "Id", tblorder.IdOrder); return(View(tblorder)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,IdType,Name,Image")] Tblfood tblfood) { if (id != tblfood.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblfood); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblfoodExists(tblfood.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdType"] = new SelectList(_context.TblTypeFs, "Id", "TypeName", tblfood.IdType); return(View(tblfood)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,SenderUser,ReceiverUser,Subject,Text,Readed")] TblMesage tblMesage) { if (id != tblMesage.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblMesage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblMesageExists(tblMesage.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblMesage)); }