public async Task <IActionResult> Create([Bind("Id,Name,Description")] OrderStatecode orderStatecode) { if (ModelState.IsValid) { _context.Add(orderStatecode); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(orderStatecode)); }
public async Task <IActionResult> Create([Bind("Id,Name,Link,Description,Local_id")] Image image) { if (ModelState.IsValid) { _context.Add(image); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(image)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Color color) { if (ModelState.IsValid) { _context.Add(color); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(color)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,ImageId")] Costumer costumer) { if (ModelState.IsValid) { _context.Add(costumer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ImageId"] = new SelectList(_context.Images, "Id", "Link", costumer.ImageId); return(View(costumer)); }
public async Task <IActionResult> Create([Bind("Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount,FirstName,LastName,RoleId,LocalId")] AspNetUser aspNetUser) { if (ModelState.IsValid) { _context.Add(aspNetUser); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LocalId"] = new SelectList(_context.Locals, "Id", "Address", aspNetUser.LocalId); ViewData["RoleId"] = new SelectList(_context.Roles, "Id", "Name", aspNetUser.RoleId); return(View(aspNetUser)); }
public async Task <IActionResult> Create([Bind("Id,UserId,OrderStatecodeId")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OrderStatecodeId"] = new SelectList(_context.OrderStatecodes, "Id", "Name", order.OrderStatecodeId); ViewData["UserId"] = new SelectList(_context.AspNetUsers, "Id", "Id", order.UserId); return(View(order)); }
public async Task <IActionResult> Create([Bind("Id,ImageId,LocalId,Name,Description,Price,CategoryId")] Item item) { if (ModelState.IsValid) { _context.Add(item); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Name", item.CategoryId); ViewData["ImageId"] = new SelectList(_context.Images, "Id", "Link", item.ImageId); ViewData["LocalId"] = new SelectList(_context.Locals, "Id", "Address", item.LocalId); return(View(item)); }