public async Task <IActionResult> Edit(int id, [Bind("ResultEntryId,ResultValue,ResultFormatId,DosageAmountId,TrialGroupId")] PtsResultEntry ptsResultEntry) { if (id != ptsResultEntry.ResultEntryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsResultEntry); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsResultEntryExists(ptsResultEntry.ResultEntryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DosageAmountId"] = new SelectList(_context.PtsDosageAmount, "DosageAmountId", "DosageAmountId", ptsResultEntry.DosageAmountId); ViewData["ResultFormatId"] = new SelectList(_context.PtsResultFormat, "ResultFormatId", "ResultFormatDescription", ptsResultEntry.ResultFormatId); ViewData["TrialGroupId"] = new SelectList(_context.PtsTrialGroup, "TrialGroupId", "TrialGroupId", ptsResultEntry.TrialGroupId); return(View(ptsResultEntry)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,ProductOwner,ProductCategoryId")] PtsProduct ptsProduct) { if (id != ptsProduct.ProductId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsProduct); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsProductExists(ptsProduct.ProductId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProductCategoryId"] = new SelectList(_context.PtsProductCategory, "ProductCategoryId", "ProductCategoryName", ptsProduct.ProductCategoryId); return(View(ptsProduct)); }
public async Task <IActionResult> Edit(int id, [Bind("TreatmentTypeId,TreatmentTypeName")] PtsTreatmentType ptsTreatmentType) { if (id != ptsTreatmentType.TreatmentTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTreatmentType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTreatmentTypeExists(ptsTreatmentType.TreatmentTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsTreatmentType)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductCategoryId,ProductCategoryName")] PtsProductCategory ptsProductCategory) { if (id != ptsProductCategory.ProductCategoryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsProductCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsProductCategoryExists(ptsProductCategory.ProductCategoryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsProductCategory)); }
public async Task <IActionResult> Edit(int id, [Bind("TrialGroupId,TrialGroupNr,PlantId,FieldBlockId")] PtsTrialGroup ptsTrialGroup) { if (id != ptsTrialGroup.TrialGroupId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTrialGroup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTrialGroupExists(ptsTrialGroup.TrialGroupId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FieldBlockId"] = new SelectList(_context.PtsFieldBlock, "FieldBlockId", "BlockChar", ptsTrialGroup.FieldBlockId); ViewData["PlantId"] = new SelectList(_context.PtsPlant, "PlantId", "PlantName", ptsTrialGroup.PlantId); return(View(ptsTrialGroup)); }
public async Task <IActionResult> Edit(int id, [Bind("TreatmentCommentId,TreatmentId,CommentId")] PtsTreatmentComment ptsTreatmentComment) { if (id != ptsTreatmentComment.TreatmentCommentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTreatmentComment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTreatmentCommentExists(ptsTreatmentComment.TreatmentCommentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CommentId"] = new SelectList(_context.PtsComment, "CommentId", "CommentText", ptsTreatmentComment.CommentId); ViewData["TreatmentId"] = new SelectList(_context.PtsTreatment, "TreatmentId", "TreatmentId", ptsTreatmentComment.TreatmentId); return(View(ptsTreatmentComment)); }
public async Task <IActionResult> Edit(int id, [Bind("FieldBlockId,BlockChar,YearCreated,BlockDescription")] PtsFieldBlock ptsFieldBlock) { if (id != ptsFieldBlock.FieldBlockId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsFieldBlock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsFieldBlockExists(ptsFieldBlock.FieldBlockId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsFieldBlock)); }
public async Task <IActionResult> Edit(int id, [Bind("UserId,Username,UserPassword,Firstname,Lastname,EmailAddress")] PtsUser ptsUser) { if (id != ptsUser.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsUser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsUserExists(ptsUser.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsUser)); }
public async Task <IActionResult> Edit(int id, [Bind("ResultFormatId,ResultFormatTitle,ResultFormatDescription,TrialBlockId,UnitTypeId")] PtsResultFormat ptsResultFormat) { if (id != ptsResultFormat.ResultFormatId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsResultFormat); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsResultFormatExists(ptsResultFormat.ResultFormatId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["TrialBlockId"] = new SelectList(_context.PtsTrialBlock, "TrialBlockId", "TrialBlockId", ptsResultFormat.TrialBlockId); ViewData["UnitTypeId"] = new SelectList(_context.PtsUnitType, "UnitTypeId", "UnitTypeName", ptsResultFormat.UnitTypeId); return(View(ptsResultFormat)); }
public async Task <IActionResult> Edit(int id, [Bind("TrialTypeDosageTypeId,TrialTypeId,DosageTypeId")] PtsTrialTypeDosageType ptsTrialTypeDosageType) { if (id != ptsTrialTypeDosageType.TrialTypeDosageTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTrialTypeDosageType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTrialTypeDosageTypeExists(ptsTrialTypeDosageType.TrialTypeDosageTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DosageTypeId"] = new SelectList(_context.PtsDosageType, "DosageTypeId", "DosageTypeId", ptsTrialTypeDosageType.DosageTypeId); ViewData["TrialTypeId"] = new SelectList(_context.PtsTrialType, "TrialTypeId", "TrialTypeId", ptsTrialTypeDosageType.TrialTypeId); return(View(ptsTrialTypeDosageType)); }
public async Task <IActionResult> Edit(int id, [Bind("TrialBlockId,TrialBlockDescription,TrialEnd,TrialTypeId,FieldBlockId")] PtsTrialBlock ptsTrialBlock) { if (id != ptsTrialBlock.TrialBlockId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTrialBlock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTrialBlockExists(ptsTrialBlock.TrialBlockId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FieldBlockId"] = new SelectList(_context.PtsFieldBlock, "FieldBlockId", "BlockChar", ptsTrialBlock.FieldBlockId); ViewData["TrialTypeId"] = new SelectList(_context.PtsTrialType, "TrialTypeId", "TrialTypeId", ptsTrialBlock.TrialTypeId); return(View(ptsTrialBlock)); }