public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Active,CronExpression")] MailSendingJob mailSendingJob) { if (id != mailSendingJob.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mailSendingJob); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MailSendingJobExists(mailSendingJob.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mailSendingJob)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,SourceBranch,TargetBranch,ChangeSetId,DevChangeSetId,Reviewer,Memo,SubmitBy,SubmitAt,UpdateBy,UpdateAt")] MergeRequest mergeRequest) { if (id != mergeRequest.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mergeRequest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MergeRequestExists(mergeRequest.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mergeRequest)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,SourceBranch,TargetBranch,ChangeSetId,IsToQa,DevChangeSetId,Memo")] MergeRequest mergeRequest) { if (id != mergeRequest.Id) { return(NotFound()); } if (ModelState.IsValid) { if (!AuthorizeAccess(mergeRequest)) { return(Forbid()); } try { mergeRequest.UpdateAt = Now; mergeRequest.UpdateBy = LoginUser; _context.Update(mergeRequest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MergeRequestExists(mergeRequest.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mergeRequest)); }