public static Model.Error404 GetError404Model(DataRow row) { Model.Error404 objModel = new General.ErrorLogging.Model.Error404(); objModel.ID = SqlConvert.ToInt32(row["Error404ID"]); objModel.AppID = SqlConvert.ToInt32(row["Error404AppID"]); objModel.Environment = (Environment.EnvironmentContext)SqlConvert.ToInt16(row["Error404EnvironmentID"]); if (row["Error404ClientID"] != DBNull.Value) { objModel.ClientID = SqlConvert.ToString(row["Error404ClientID"]); } if (row["Error404FirstTime"] != DBNull.Value) { objModel.FirstTime = (DateTimeOffset)row["Error404FirstTime"]; } if (row["Error404LastTime"] != DBNull.Value) { objModel.LastTime = (DateTimeOffset)row["Error404LastTime"]; } objModel.URL = SqlConvert.ToString(row["Error404URL"]); objModel.Count = SqlConvert.ToInt16(row["Error404Count"]); objModel.Hide = SqlConvert.ToBoolean(row["Error404Hide"]); objModel.UserAgent = SqlConvert.ToString(row["Error404UserAgent"]); objModel.Detail = SqlConvert.ToString(row["Error404Detail"]); if (row.Table.Columns.Contains("AppURL")) { objModel.AppName = SqlConvert.ToString(row["AppName"]); objModel.AppURL = SqlConvert.ToString(row["AppURL"]); } return(objModel); }
public static Model.Error404Redirect GetError404RedirectModel(DataRow row) { Model.Error404Redirect objModel = new General.ErrorLogging.Model.Error404Redirect(); objModel.ID = SqlConvert.ToInt32(row["Error404RedirectID"]); objModel.AppID = SqlConvert.ToInt32(row["Error404RedirectAppID"]); objModel.ClientID = SqlConvert.ToString(row["Error404RedirectClientID"]); if (row["Error404RedirectCreateDate"] != DBNull.Value) { objModel.CreateDate = (DateTimeOffset)row["Error404RedirectCreateDate"]; } if (row["Error404RedirectModifyDate"] != DBNull.Value) { objModel.ModifyDate = (DateTimeOffset)row["Error404RedirectModifyDate"]; } objModel.RedirectType = SqlConvert.ToInt16(row["Error404RedirectRedirectType"]); objModel.From = SqlConvert.ToString(row["Error404RedirectFrom"]); objModel.To = SqlConvert.ToString(row["Error404RedirectTo"]); if (row["Error404RedirectFirstTime"] != DBNull.Value) { objModel.FirstTime = (DateTimeOffset)row["Error404RedirectFirstTime"]; } if (row["Error404RedirectLastTime"] != DBNull.Value) { objModel.LastTime = (DateTimeOffset)row["Error404RedirectLastTime"]; } objModel.Count = SqlConvert.ToInt32(row["Error404RedirectCount"]); if (row.Table.Columns.Contains("AppURL")) { objModel.AppName = SqlConvert.ToString(row["AppName"]); objModel.AppURL = SqlConvert.ToString(row["AppURL"]); } return(objModel); }
public static Model.Application GetApplicationSettingsModel(DataRow row) { Model.Application objModel = new General.ErrorLogging.Model.Application(); objModel.ID = SqlConvert.ToInt32(row["AppID"]); objModel.Name = SqlConvert.ToString(row["AppName"]); objModel.URL = SqlConvert.ToString(row["AppURL"]); if (row["AppSortOrder"] != DBNull.Value) { objModel.SortOrder = SqlConvert.ToInt32(row["AppSortOrder"]); } if (row["AppCustomID"] != DBNull.Value) { objModel.CustomID = SqlConvert.ToInt32(row["AppCustomID"]); } objModel.Custom1 = SqlConvert.ToString(row["AppCustom1"]); objModel.Custom2 = SqlConvert.ToString(row["AppCustom2"]); objModel.Custom3 = SqlConvert.ToString(row["AppCustom3"]); return(objModel); }
public static ILoggingFilter GetFilterModel(DataRow row, LoggingFilterViewType viewType = LoggingFilterViewType.Full) { ILoggingFilter objModel; if (viewType == LoggingFilterViewType.Browser) { objModel = new General.ErrorLogging.Model.LoggingFilterBrowserView(); } else if (viewType == LoggingFilterViewType.RemoteServer) { objModel = new General.ErrorLogging.Model.LoggingFilterRemoteServerView(); } else { objModel = new General.ErrorLogging.Model.LoggingFilter(); } objModel.ID = SqlConvert.ToInt32(row["FilterID"]); objModel.Name = SqlConvert.ToString(row["FilterName"]); objModel.AppID = SqlConvert.ToInt32(row["FilterAppID"]); //if (row["AppFilter"] != DBNull.Value && !StringFunctions.IsNullOrWhiteSpace(row["AppFilter"].ToString())) // objModel.AppFilter = Model.ApplicationFilterModel.FromJson<Model.ApplicationFilterModel>(row["AppFilter"].ToString()); if (row["ClientFilter"] != DBNull.Value && !StringFunctions.IsNullOrWhiteSpace(row["ClientFilter"].ToString())) { objModel.ClientFilter = Model.ClientFilterModel.FromJson <Model.ClientFilterModel>(row["ClientFilter"].ToString()); } if (row["UserFilter"] != DBNull.Value && !StringFunctions.IsNullOrWhiteSpace(row["UserFilter"].ToString())) { objModel.UserFilter = Model.UserFilterModel.FromJson <Model.UserFilterModel>(row["UserFilter"].ToString()); } if (row["EnvironmentFilter"] != DBNull.Value && !StringFunctions.IsNullOrWhiteSpace(row["EnvironmentFilter"].ToString())) { objModel.EnvironmentFilter = Model.EnvironmentFilterModel.FromJson <Model.EnvironmentFilterModel>(row["EnvironmentFilter"].ToString()); } if (row["EventFilter"] != DBNull.Value && !StringFunctions.IsNullOrWhiteSpace(row["EventFilter"].ToString())) { objModel.EventFilter = Model.EventFilterModel.FromJson <Model.EventFilterModel>(row["EventFilter"].ToString()); } objModel.Enabled = SqlConvert.ToBoolean(row["FilterEnabled"]); if (row["FilterStartDate"] != DBNull.Value) { objModel.StartDate = (DateTimeOffset)row["FilterStartDate"]; } if (row["FilterEndDate"] != DBNull.Value) { objModel.EndDate = (DateTimeOffset)row["FilterEndDate"]; } if (row["FilterPageEmail"] != DBNull.Value) { objModel.PageEmail = (EmailAddress)row["FilterPageEmail"].ToString(); } if (row["FilterPageSMS"] != DBNull.Value) { objModel.PageSMS = (PhoneNumber)row["FilterPageSMS"].ToString(); } General.FingerPrint objFingerPrint = new General.FingerPrint(); objFingerPrint.CreatedBy = SqlConvert.ToInt32(row["FilterCreatedBy"]); if (row["FilterCreateDate"] != DBNull.Value) { objFingerPrint.CreatedOn = ((DateTimeOffset)row["FilterCreateDate"]).LocalDateTime; } if (row["FilterModifyDate"] != DBNull.Value) { objFingerPrint.ModifiedOn = ((DateTimeOffset)row["FilterModifyDate"]).LocalDateTime; } objModel.FingerPrint = objFingerPrint; objModel.Custom1 = SqlConvert.ToString(row["FilterCustom1"]); objModel.Custom2 = SqlConvert.ToString(row["FilterCustom2"]); objModel.Custom3 = SqlConvert.ToString(row["FilterCustom3"]); return(objModel); }