public override void Execute(object parameter) { var selectedMessage = (StoredMessage)parameter; var model = new ExceptionDetailViewModel(settingsProvider, new ExceptionDetails(selectedMessage)); windowManager.ShowDialog(model); }
public override void Execute(object parameter) { var selectedMessage = (StoredMessage)parameter; var model = new ExceptionDetailViewModel(settingsProvider, new ExceptionDetails(selectedMessage)); windowManager.ShowDialog(model); }
public JsonResult GetExceptionLogDetail(string id) { return(ExecuteFunctionRun(() => { ActionResult result = new ActionResult(); ExceptionDetailViewModel model = new ExceptionDetailViewModel(); bool isFixed = false;//是否已修复 OThinker.H3.Exceptions.ExceptionLog log = this.Engine.ExceptionManager.GetException(id); if (log != null) { model.Action = log.Action.ToString(); model.Block = log.Block.ToString(); OThinker.H3.Instance.InstanceContext context = this.Engine.InstanceManager.GetInstanceContext(log.InstanceId); if (context == null) { result.Message = "ExceptionLog.WorkflowNotExist"; result.Success = false; return Json(result, JsonRequestBehavior.AllowGet); } model.InstanceName = string.IsNullOrWhiteSpace(context.InstanceName) ? context.InstanceId : context.InstanceName; model.InstanceUrl = this.GetInstanceUrl(log.InstanceId, DateTime.Now.ToString("yyyyMMddHHmmss")); model.Message = log.Message.Replace("\r\n", "<BR>"); if (log.State == OThinker.H3.Exceptions.ExceptionState.Fixed) { model.Fix = "ExceptionLog.Fixed"; model.FixTime = log.FixedTime.ToString(); isFixed = true; } else { model.Fix = "ExceptionLog.UnFixed"; model.FixTime = null; isFixed = false; } model.ObjectID = log.ObjectID; model.WorkflowPackage = log.WorkflowCode; model.WorkflowVersion = log.WorkflowVersion.ToString(); model.SourceName = log.SourceName; model.ExceptionSource = log.SourceType.ToString(); model.OccurrenceTime = log.ThrownTime.ToString(); } result.Success = true; result.Extend = new { IsFixed = isFixed, ExceptionDetail = model }; return Json(result, JsonRequestBehavior.AllowGet); })); }
public override void OnException(HttpActionExecutedContext filterContext) { var exceptionDetailViewModel = new ExceptionDetailViewModel() { ExceptionMessage = filterContext.Exception.Message, StackTrace = filterContext.Exception.StackTrace, ControllerName = filterContext.ActionContext.ControllerContext.Controller.ToString(), Date = DateTime.Now }; //IExceptionDetailManager exceptionDetailManager = new ExceptionDetailManager(new UnitOfWork(new ApplicationContext("DefaultConnection"))); var exceptionDetailManager = DependencyResolver.Current.GetService <IExceptionDetailManager>(); var exceptionDetail = Mapper.Map <ExceptionDetailViewModel, ExceptionDetailTransport>(exceptionDetailViewModel); exceptionDetailManager.CreateExceptionDetail(exceptionDetail); }