public ActionResult SubmitBugReport() { try { var userId = Guid.Parse(User.Identity.GetUserId()); var securityUserInfo = this.AmiClient.GetUser(userId.ToString()); if (securityUserInfo == null) { TempData["error"] = Locale.UserNotFound; return(RedirectToAction("Index")); } var model = new SubmitBugReportModel(securityUserInfo); return(View(model)); } catch (Exception e) { Trace.TraceError($"Unable to submit bug report: {e}"); } TempData["error"] = Locale.UserNotFound; return(RedirectToAction("Index")); }
public ActionResult SubmitBugReport(SubmitBugReportModel model) { try { if (ModelState.IsValid) { var report = model.ToDiagnosticReport(this.GetUserEntityBySecurityUserKey(Guid.Parse(this.User.Identity.GetUserId()))); report = AmiClient.SubmitDiagnosticReport(report); model.TransactionMessage = report.CorrelationId; model.Success = true; } } catch (Exception e) { Trace.TraceError($"Unable to submit bug report: {e}"); } return(View(model)); }