public async Task <IActionResult> Edit(int id, [Bind("IdLaboratory,NumberLaboratory,IdEquipment")] Laboratories laboratories) { if (id != laboratories.IdLaboratory) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(laboratories); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LaboratoriesExists(laboratories.IdLaboratory)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdEquipment"] = new SelectList(_context.Equipments, "IdEquipment", "IdEquipment", laboratories.IdEquipment); return(View(laboratories)); }
public async Task <IActionResult> Edit(int id, [Bind("IdEquipment,NameEquipment,DateRelease")] Equipments equipments) { if (id != equipments.IdEquipment) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(equipments); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EquipmentsExists(equipments.IdEquipment)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(equipments)); }
public async Task <IActionResult> Edit(int id, [Bind("IdSupple,IdProvider,Price,DateSupple,IdMaterial")] Supplies supplies) { if (id != supplies.IdSupple) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(supplies); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SuppliesExists(supplies.IdSupple)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdMaterial"] = new SelectList(_context.Materials, "IdMaterial", "IdMaterial", supplies.IdMaterial); ViewData["IdProvider"] = new SelectList(_context.Providers, "IdProvider", "IdProvider", supplies.IdProvider); return(View(supplies)); }
public async Task <IActionResult> Edit(int id, [Bind("IdExperiment,IdSample,Dates,StartTime,EndTime,SupposeMass,ReceiveMass,IdLaboratory,IdWorker")] Experiments experiments) { if (id != experiments.IdExperiment) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(experiments); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExperimentsExists(experiments.IdExperiment)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdLaboratory"] = new SelectList(_context.Laboratories, "IdLaboratory", "IdLaboratory", experiments.IdLaboratory); ViewData["IdSample"] = new SelectList(_context.Samples, "IdSample", "IdSample", experiments.IdSample); ViewData["IdWorker"] = new SelectList(_context.Workers, "IdWorker", "IdWorker", experiments.IdWorker); return(View(experiments)); }
public async Task <IActionResult> Edit(int id, [Bind("IdWorker,Surname,Firstname,Adress,Birthday")] Workers workers) { if (id != workers.IdWorker) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(workers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkersExists(workers.IdWorker)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(workers)); }
public async Task <IActionResult> Edit(int id, [Bind("IdMaterial,NameMaterial,MassMaterial,Units,Property")] Materials materials) { if (id != materials.IdMaterial) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(materials); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MaterialsExists(materials.IdMaterial)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(materials)); }