public async Task <IActionResult> Create([Bind("Id,Surname,Name,Patronymic,Mobile_Number,Email")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description")] TypeProduct typeProduct) { if (ModelState.IsValid) { _context.Add(typeProduct); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeProduct)); }
public async Task <IActionResult> Create([Bind("Id,Name,Adress,Mobile_Number,Email")] Provider provider) { if (ModelState.IsValid) { _context.Add(provider); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(provider)); }
public async Task <IActionResult> Create([Bind("Id,Name,Salary,Responsibility")] Post post) { if (ModelState.IsValid) { _context.Add(post); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Country country) { if (ModelState.IsValid) { _context.Add(country); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(country)); }
public async Task <IActionResult> Create([Bind("Id,Name,IdCountry")] Creator creator) { if (ModelState.IsValid) { _context.Add(creator); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdCountry"] = new SelectList(_context.Countries, "Id", "Id", creator.IdCountry); return(View(creator)); }
public async Task <IActionResult> Create([Bind("Id,IdClient,Data")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdClient"] = new SelectList(_context.Clients, "Id", "Id", order.IdClient); return(View(order)); }
public async Task <IActionResult> Create([Bind("Id,Surname,Name,Patronymic,Mobile_Number,IdPost")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdPost"] = new SelectList(_context.Posts, "Id", "Id", employee.IdPost); return(View(employee)); }
public async Task <IActionResult> Create([Bind("Id,Name,IdTypeProduct,IdCreator")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdCreator"] = new SelectList(_context.Creators, "Id", "Id", product.IdCreator); ViewData["IdTypeProduct"] = new SelectList(_context.TypeProducts, "Id", "Id", product.IdTypeProduct); return(View(product)); }
public async Task <IActionResult> Create([Bind("Id,IdProduct,IdOrder,IdProvider,IdEmployee,DateDelivery,DateDeparture")] Sending sending) { if (ModelState.IsValid) { _context.Add(sending); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdEmployee"] = new SelectList(_context.Employees, "Id", "Id", sending.IdEmployee); ViewData["IdOrder"] = new SelectList(_context.Order, "Id", "Id", sending.IdOrder); ViewData["IdProduct"] = new SelectList(_context.Products, "Id", "Id", sending.IdProduct); ViewData["IdProvider"] = new SelectList(_context.Providers, "Id", "Id", sending.IdProvider); return(View(sending)); }