Example #1
0
 protected void FillModel(Model.ErrorOther objModel)
 {
     this.ID               = objModel.ID;
     this.AppID            = objModel.AppID;
     this.Environment      = objModel.Environment;
     this.ClientID         = objModel.ClientID;
     this.FirstTime        = objModel.FirstTime;
     this.LastTime         = objModel.LastTime;
     this.Count            = objModel.Count;
     this.EventType        = objModel.EventType;
     this.Severity         = objModel.Severity;
     this.ErrorCode        = objModel.ErrorCode;
     this.CodeMethod       = objModel.CodeMethod;
     this.CodeFileName     = objModel.CodeFileName;
     this.CodeLineNumber   = objModel.CodeLineNumber;
     this.CodeColumnNumber = objModel.CodeColumnNumber;
     this.ExceptionType    = objModel.ExceptionType;
     this.EventName        = objModel.EventName;
     this.EventDetail      = objModel.EventDetail;
     this.EventURL         = objModel.EventURL;
     this.UserAgent        = objModel.UserAgent;
     this.UserType         = objModel.UserType;
     this.UserID           = objModel.UserID;
     this.CustomID         = objModel.CustomID;
     this.AppName          = objModel.AppName;
     this.MachineName      = objModel.MachineName;
     this.Custom1          = objModel.Custom1;
     this.Custom2          = objModel.Custom2;
     this.Custom3          = objModel.Custom3;
     this.Duration         = objModel.Duration;
 }
Example #2
0
        public static EventReporterResponse StoreEventInDatabase(Model.ErrorOther model, ApplicationContext context, FilterContext filterContext, EventHistoryContext historyContext = null)
        {
            EventReporterResponse response = new EventReporterResponse();

            response.IncidentID = General.ErrorLogging.Data.ErrorOther.StoreEvent(model, filterContext, historyContext);
            response.Success    = true;
            return(response);
        }
        public static async Task <EventReporterResponse> StoreEvent(Model.ErrorOther model, ApplicationContext appContext, FilterContext filterContext = null, EventHistoryContext historyContext = null)
        {
            try
            {
                EventReporterResponse result = new EventReporterResponse();
                if (ErrorReporter.ErrorLogUseSQLConnToReport)
                {
                    //Read the AppContext into the model
                    if (appContext.AppID.HasValue)
                    {
                        model.AppID = appContext.AppID.Value;
                    }
                    model.AppName     = appContext.AppName;
                    model.ClientID    = appContext.ClientID;
                    model.Custom1     = appContext.Custom1;
                    model.Custom2     = appContext.Custom2;
                    model.Custom3     = appContext.Custom3;
                    model.CustomID    = appContext.CustomID;
                    model.Environment = ErrorReporter.GetEnvironment(appContext);
                    model.MachineName = appContext.MachineName;
                    model.UserID      = appContext.UserID;
                    model.UserType    = appContext.UserType;

                    //Talk to database
                    try
                    {
                        result = General.ErrorLogging.Server.EventLogServer.StoreEventInDatabase(model, appContext, filterContext, historyContext);
                    }
                    catch (Exception ex)
                    {
                        throw;
                    }
                }
                else
                {
                    //Read the model into an EventContext
                    EventContext eventContext = new EventContext(model);

                    //Prepare Web Service request
                    RecordEventDataContext request = new RecordEventDataContext();
                    request.AccessCode    = ErrorReporter.ErrorAPIWriteOnlyAccessCode;
                    request.AppContext    = appContext;
                    request.EventContext  = eventContext;
                    request.FilterContext = filterContext;
                    request.EventHistory  = historyContext;

                    //Make Web Service Call
                    result = await StoreEvent(request).ConfigureAwait(false);
                }
                return(result);
            }
            catch
            {
                throw;
            }
        }