Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CheckPermissions(false))
        {
            return;
        }

        int          eventId = QueryHelper.GetInteger("eventid", 0);
        EventLogInfo ev      = EventLogInfo.Provider.Get(eventId);

        // Set edited object
        EditedObject = ev;

        if (ev != null)
        {
            UTF8Encoding enc  = new UTF8Encoding();
            string       text = HTMLHelper.StripTags(HttpUtility.HtmlDecode(EventLogHelper.GetEventText(ev)));
            byte[]       file = enc.GetBytes(text);

            Response.AddHeader("Content-disposition", "attachment; filename=eventdetails.txt");
            Response.ContentType = "text/plain";
            Response.BinaryWrite(file);

            RequestHelper.EndResponse();
        }
    }
Пример #2
0
    /// <summary>
    /// Gets and updates abuse report. Called when the "Get and update report" button is pressed.
    /// Expects the LogEvent method to be run first.
    /// </summary>
    private bool GetAndUpdateEvent()
    {
        // Create new instance of event log provider
        EventLogProvider eventLog = new EventLogProvider();

        // Get top 1 event matching the where condition
        string where = "EventCode = 'APIEXAMPLE'";
        int     topN   = 1;
        DataSet events = eventLog.GetAllEvents(where, null, topN, null);

        if (!DataHelper.DataSourceIsEmpty(events))
        {
            // Create the object from DataRow
            EventLogInfo updateEvent = new EventLogInfo(events.Tables[0].Rows[0]);

            // Update the properties
            updateEvent.EventDescription = updateEvent.EventDescription.ToLower();

            // Save the changes
            eventLog.SetEventLogInfo(updateEvent);

            return(true);
        }

        return(false);
    }
Пример #3
0
    /// <summary>
    /// Gets and bulk updates eventss. Called when the "Get and bulk update events" button is pressed.
    /// Expects the LogEvent method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateEvents()
    {
        // Create new instance of event log provider
        EventLogProvider eventLog = new EventLogProvider();

        // Get events matching the where condition
        string where = "EventCode = 'APIEXAMPLE'";
        DataSet events = eventLog.GetAllEvents(where, null);

        if (!DataHelper.DataSourceIsEmpty(events))
        {
            // Loop through the individual items
            foreach (DataRow eventDr in events.Tables[0].Rows)
            {
                // Create the object from DataRow
                EventLogInfo updateEvent = new EventLogInfo(eventDr);

                // Update the properties
                updateEvent.EventDescription = updateEvent.EventDescription.ToUpper();

                // Save the changes
                eventLog.SetEventLogInfo(updateEvent);
            }

            return(true);
        }

        return(false);
    }
Пример #4
0
        private string GetLogEventDetails(EventLogInfo record)
        {
            if (record == null)
            {
                return("<null>");
            }

            var sb = new StringBuilder();

            sb.AppendLine($"Time: {record.EventTime}")
            .AppendLine($"Source: {record.Source}")
            .AppendLine($"Type: {record.EventType}")
            .AppendLine($"Code: {record.EventCode}")
            .AppendLine($"ID: {record.EventID}")
            .AppendLine($"User ID: {record.UserID}")
            .AppendLine($"User name: {record.UserName}")
            .AppendLine($"IP address: {record.IPAddress}")
            .AppendLine($"Description: {record.EventDescription}")
            .AppendLine($"Machine name: {record.EventMachineName}")
            .AppendLine($"Event URL: {record.EventUrl}")
            .AppendLine($"URL referrer: {record.EventUrlReferrer}")
            .AppendLine($"User agent: {record.EventUserAgent}");

            return(sb.ToString());
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateEventLog(EventLogInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update tbEventLogInfo set ");
            strSql.Append("UserID=@UserID,");
            strSql.Append("eMSG=@eMSG,");
            strSql.Append("eAppendTime=@eAppendTime");
            strSql.Append(" where EventLogID=@EventLogID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID",      SqlDbType.Int,          4),
                new SqlParameter("@eMSG",        SqlDbType.VarChar,   1024),
                new SqlParameter("@eAppendTime", SqlDbType.DateTime),
                new SqlParameter("@EventLogID",  SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserID;
            parameters[1].Value = model.eMSG;
            parameters[2].Value = model.eAppendTime;
            parameters[3].Value = model.EventLogID;

            int rows = DbHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
    /// <summary>
    /// Gets and bulk updates events. Called when the "Get and bulk update events" button is pressed.
    /// Expects the LogEvent method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateEvents()
    {
        // Get events matching the where condition
        string where = "EventCode = 'APIEXAMPLE'";
        DataSet events = EventLogProvider.GetAllEvents(where, null);

        if (!DataHelper.DataSourceIsEmpty(events))
        {
            // Loop through the individual items
            foreach (DataRow eventDr in events.Tables[0].Rows)
            {
                // Create the object from DataRow
                EventLogInfo updateEvent = new EventLogInfo(eventDr);

                // Update the properties
                updateEvent.EventDescription = updateEvent.EventDescription.ToUpper();

                // Save the changes
                EventLogProvider.SetEventLogInfo(updateEvent);
            }

            return true;
        }

        return false;
    }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int AddEventLog(EventLogInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into tbEventLogInfo(");
            strSql.Append("UserID,eMSG,eAppendTime)");
            strSql.Append(" values (");
            strSql.Append("@UserID,@eMSG,@eAppendTime)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID",      SqlDbType.Int,        4),
                new SqlParameter("@eMSG",        SqlDbType.VarChar, 1024),
                new SqlParameter("@eAppendTime", SqlDbType.DateTime)
            };
            parameters[0].Value = model.UserID;
            parameters[1].Value = model.eMSG;
            parameters[2].Value = model.eAppendTime;

            object obj = DbHelper.ExecuteScalar(CommandType.Text, strSql.ToString(), parameters);

            if (obj == null)
            {
                return(-1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Пример #8
0
        public void AddEvent(string strManagerName, string strMsg, int intType)
        {
            EventLogInfo eventLogInfo = new EventLogInfo();

            eventLogInfo.UserName  = strManagerName;
            eventLogInfo.EventType = intType;
            eventLogInfo.Lang      = JObject.cultureLang;
            string iP = IPUtils.GetIP();

            if (!string.IsNullOrEmpty(iP))
            {
                eventLogInfo.IPAddress = iP;
                if (intType.Equals(1))
                {
                    eventLogInfo.IPArea = IPUtils.GetIPAreaFromPcOnline(eventLogInfo.IPAddress);
                }
                else
                {
                    eventLogInfo.IPArea = string.Empty;
                }
            }
            else
            {
                eventLogInfo.IPAddress = "127.0.0.1";
                eventLogInfo.IPArea    = "未知地址或者获取地址失败";
            }
            eventLogInfo.EventInfo     = strMsg;
            eventLogInfo.AutoTimeStamp = DateTime.Now;
            EventLog.Add(eventLogInfo);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="eventLog"></param>
        public static void LogEvent(EventLogInfo eventLog)
        {
            try
            {
                Database db = DatabaseFactory.CreateDatabase();

                DbCommand command = db.GetSqlStringCommand(TL_SYS_EVENT_LOG_INSERT);

                db.AddInParameter(command, "@EVENT_ID", DbType.Int32, DBConvert.ToDBValue((int)eventLog.EventId));
                db.AddInParameter(command, "@EVENT_SOURCE", DbType.AnsiString, DBConvert.ToDBValue(eventLog.EventSource));
                db.AddInParameter(command, "@EVENT_STATE", DbType.Int32, DBConvert.ToDBValue((int)eventLog.EventState));
                db.AddInParameter(command, "@EVENT_TYPE", DbType.Int32, DBConvert.ToDBValue((int)eventLog.EventType));
                db.AddInParameter(command, "@EVENT_LEVEL", DbType.Int32, DBConvert.ToDBValue((int)eventLog.EventLevel));
                db.AddInParameter(command, "@EVENT_DETAIL", DbType.AnsiString, DBConvert.ToDBValue(eventLog.EventDetail));
                db.AddInParameter(command, "@PARAMETER1", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter1));
                db.AddInParameter(command, "@PARAMETER2", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter2));
                db.AddInParameter(command, "@PARAMETER3", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter3));
                db.AddInParameter(command, "@PARAMETER4", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter4));
                db.AddInParameter(command, "@PARAMETER5", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter5));
                db.AddInParameter(command, "@PARAMETER6", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter6));
                db.AddInParameter(command, "@PARAMETER7", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter7));
                db.AddInParameter(command, "@PARAMETER8", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter8));
                db.AddInParameter(command, "@PARAMETER9", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter9));
                db.AddInParameter(command, "@PARAMETER10", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter10));
                db.AddInParameter(command, "@COMMENTS", DbType.AnsiString, DBConvert.ToDBValue(eventLog.Parameter10));

                db.ExecuteNonQuery(command);
            }
            catch (System.Exception ex)
            {
                Logger.Instance.Error(typeof(EventLogger), "事件日管理", "写事件日志失败, 相关参数" + eventLog.ToString(), ex);
                //Logger.Instance.Error(typeof(EventLogger), "写事件日志失败, 相关参数" + eventLog.ToString() + "错误信息:"+ ex.Message);
            }
        }
Пример #10
0
        public static int AddEventLog(int UserID, string eMSG)
        {
            EventLogInfo model = new EventLogInfo();

            model.UserID      = UserID;
            model.eMSG        = eMSG;
            model.eAppendTime = DateTime.Now;
            return(DatabaseProvider.GetInstance().AddEventLog(model));
        }
Пример #11
0
    /// <summary>
    /// Loads data of specific EventLog from DB.
    /// </summary>
    protected void LoadData()
    {
        EventLogInfo ev = EventInfo;

        //Set edited object
        EditedObject = ev;

        if (ev != null)
        {
            // Rewrite event type text.
            lblEventTypeValue.Text = EventLogHelper.GetEventTypeText(ev.EventType);
            lblEventIDValue.Text   = ev.EventID.ToString();
            lblEventTimeValue.Text = ev.EventTime.ToString();
            lblSourceValue.Text    = HTMLHelper.HTMLEncode(ev.Source);
            lblEventCodeValue.Text = HTMLHelper.HTMLEncode(ev.EventCode);

            lblUserIDValue.Text = ev.UserID.ToString();
            plcUserID.Visible   = (ev.UserID > 0);

            lblUserNameValue.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(ev.UserName));
            plcUserName.Visible   = !string.IsNullOrEmpty(lblUserNameValue.Text);

            lblIPAddressValue.Text = ev.IPAddress;

            lblNodeIDValue.Text = ev.NodeID.ToString();
            plcNodeID.Visible   = (ev.NodeID > 0);

            lblNodeNameValue.Text = HTMLHelper.HTMLEncode(ev.DocumentName);
            plcNodeName.Visible   = !string.IsNullOrEmpty(lblNodeNameValue.Text);

            // Replace HTML except line endings (<br /> or \r\n)
            var    newLineRegex = RegexHelper.GetRegex(@"(<br[ ]?/>)|([\r]?\n)");
            string description  = TruncateDescription(ev.EventDescription);
            description = HTMLHelper.StripTags(newLineRegex.Replace(description, EOL_REPLACEMENT));
            lblEventDescriptionValue.Text = HTMLHelper.HTMLEncode(description).Replace(EOL_REPLACEMENT, "<br />");

            if (ev.SiteID > 0)
            {
                SiteInfo si = SiteInfoProvider.GetSiteInfo(ev.SiteID);
                if (si != null)
                {
                    lblSiteNameValue.Text = HTMLHelper.HTMLEncode(si.DisplayName);
                }
            }
            else
            {
                plcSite.Visible = false;
            }

            lblMachineNameValue.Text = HTMLHelper.HTMLEncode(ev.EventMachineName);
            lblEventUrlValue.Text    = HTMLHelper.HTMLEncode(ev.EventUrl);
            lblUrlReferrerValue.Text = HTMLHelper.HTMLEncode(ev.EventUrlReferrer);
            lblUserAgentValue.Text   = HTMLHelper.HTMLEncode(ev.EventUserAgent);
        }
    }
Пример #12
0
    /// <summary>
    /// Loads data of specific EventLog from DB.
    /// </summary>
    protected void LoadData()
    {
        EventLogInfo ev = EventLogProvider.GetEventLogInfo(eventId);

        //Set edited object
        EditedObject = ev;

        if (ev != null)
        {
            string eventType = ValidationHelper.GetString(ev.GetValue("EventType"), string.Empty);

            // Rewrite event type text.
            lblEventTypeValue.Text = EventLogHelper.GetEventTypeText(eventType);
            lblEventIDValue.Text   = ValidationHelper.GetString(ev.GetValue("EventID"), string.Empty);
            lblEventTimeValue.Text = ValidationHelper.GetString(ev.GetValue("EventTime"), string.Empty);
            lblSourceValue.Text    = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("Source"), string.Empty));
            lblEventCodeValue.Text = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("EventCode"), string.Empty));

            lblUserIDValue.Text = ValidationHelper.GetString(ev.GetValue("UserID"), string.Empty);
            plcUserID.Visible   = (lblUserIDValue.Text != string.Empty);

            lblUserNameValue.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(ValidationHelper.GetString(ev.GetValue("UserName"), string.Empty)));
            plcUserName.Visible   = (lblUserNameValue.Text != string.Empty);

            lblIPAddressValue.Text = ValidationHelper.GetString(ev.GetValue("IPAddress"), string.Empty);

            lblNodeIDValue.Text = ValidationHelper.GetString(ev.GetValue("NodeID"), string.Empty);
            plcNodeID.Visible   = (lblNodeIDValue.Text != string.Empty);

            lblNodeNameValue.Text = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("DocumentName"), string.Empty));
            plcNodeName.Visible   = (lblNodeNameValue.Text != string.Empty);

            string description = HTMLHelper.StripTags(ValidationHelper.GetString(ev.GetValue("EventDescription"), string.Empty).Replace("<br />", "\r\n").Replace("<br/>", "\r\n"));
            lblEventDescriptionValue.Text = HTMLHelper.EnsureLineEnding(HTMLHelper.HTMLEncode(description), "<br />");

            if (!DataHelper.IsEmpty(ev.GetValue("SiteID")))
            {
                SiteInfo si = SiteInfoProvider.GetSiteInfo(Convert.ToInt32(ev.GetValue("SiteID")));
                if (si != null)
                {
                    lblSiteNameValue.Text = HTMLHelper.HTMLEncode(si.DisplayName);
                }
            }
            else
            {
                plcSite.Visible = false;
            }

            lblMachineNameValue.Text = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("EventMachineName"), string.Empty));
            lblEventUrlValue.Text    = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("EventUrl"), string.Empty));
            lblUrlReferrerValue.Text = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("EventUrlReferrer"), string.Empty));
            lblUserAgentValue.Text   = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ev.GetValue("EventUserAgent"), string.Empty));
        }
    }
Пример #13
0
    /// <summary>
    /// Loads data of specific EventLog from DB.
    /// </summary>
    protected void LoadData()
    {
        EventLogInfo ev = EventInfo;

        //Set edited object
        EditedObject = ev;

        if (ev != null)
        {
            // Rewrite event type text.
            lblEventTypeValue.Text = EventLogHelper.GetEventTypeText(ev.EventType);
            lblEventIDValue.Text   = ev.EventID.ToString();
            lblEventTimeValue.Text = ev.EventTime.ToString();
            lblSourceValue.Text    = HTMLHelper.HTMLEncode(ev.Source);
            lblEventCodeValue.Text = HTMLHelper.HTMLEncode(ev.EventCode);

            lblUserIDValue.Text = ev.UserID.ToString();
            plcUserID.Visible   = (ev.UserID > 0);

            lblUserNameValue.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(ev.UserName));
            plcUserName.Visible   = !string.IsNullOrEmpty(lblUserNameValue.Text);

            lblIPAddressValue.Text = ev.IPAddress;

            lblNodeIDValue.Text = ev.NodeID.ToString();
            plcNodeID.Visible   = (ev.NodeID > 0);

            lblNodeNameValue.Text = HTMLHelper.HTMLEncode(ev.DocumentName);
            plcNodeName.Visible   = !string.IsNullOrEmpty(lblNodeNameValue.Text);

            string description = HTMLHelper.StripTags(ev.EventDescription.Replace("<br />", "\r\n").Replace("<br/>", "\r\n"));
            lblEventDescriptionValue.Text = HTMLHelper.EnsureLineEnding(HTMLHelper.HTMLEncode(description), "<br />");

            if (ev.SiteID > 0)
            {
                SiteInfo si = SiteInfoProvider.GetSiteInfo(ev.SiteID);
                if (si != null)
                {
                    lblSiteNameValue.Text = HTMLHelper.HTMLEncode(si.DisplayName);
                }
            }
            else
            {
                plcSite.Visible = false;
            }

            lblMachineNameValue.Text = HTMLHelper.HTMLEncode(ev.EventMachineName);
            lblEventUrlValue.Text    = HTMLHelper.HTMLEncode(ev.EventUrl);
            lblUrlReferrerValue.Text = HTMLHelper.HTMLEncode(ev.EventUrlReferrer);
            lblUserAgentValue.Text   = HTMLHelper.HTMLEncode(ev.EventUserAgent);
        }
    }
Пример #14
0
        public static int Add(EventLogInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <EventLogInfo>(entity);
            }
            return(result);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="eventId"></param>
        /// <param name="eventType"></param>
        /// <param name="eventLevel"></param>
        /// <param name="eventState"></param>
        /// <param name="eventSource"></param>
        /// <param name="eventBrief"></param>
        /// <param name="eventDetail"></param>
        /// <param name="eventTime"></param>
        public static void LogEvent(EventID eventId, EventType eventType, EventLevel eventLevel,
                                    EventState eventState, string eventSource, string eventBrief,
                                    string eventDetail, DateTime eventTime)
        {
            EventLogInfo eventInfo = new EventLogInfo();

            eventInfo.EventId     = eventId;
            eventInfo.EventState  = eventState;
            eventInfo.EventType   = eventType;
            eventInfo.EventSource = eventSource;
            eventInfo.EventDetail = eventDetail;
            eventInfo.EventTime   = eventTime;

            LogEvent(eventInfo);
        }
Пример #16
0
    /// <summary>
    /// Returns system information.
    /// </summary>
    private static string GetSystemInformation()
    {
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("CMS version: {0} Build: {1}",
                        CMSVersion.MainVersion,
                        CMSVersion.GetVersion(true, true, true, true));
        sb.AppendLine();

        sb.AppendFormat("OS version: {0}", Environment.OSVersion);
        sb.AppendLine();

        LicenseKeyInfo licenseKey = null;

        if (SiteContext.CurrentSite != null)
        {
            licenseKey = LicenseKeyInfoProvider.GetLicenseKeyInfo(SiteContext.CurrentSite.DomainName);
        }

        if (licenseKey != null)
        {
            sb.AppendFormat("License info: {0}, {1}, {2}, {3}",
                            licenseKey.Domain,
                            licenseKey.Edition,
                            licenseKey.ExpirationDateReal.ToString(DateTimeHelper.DefaultIFormatProvider),
                            licenseKey.Version);

            string packages = ValidationHelper.GetString(licenseKey.GetValue("LicensePackages"), string.Empty);
            if (!string.IsNullOrEmpty(packages))
            {
                sb.AppendFormat(", {0}", packages);
            }
        }

        int eventId = QueryHelper.GetInteger("eventid", 0);

        if (eventId > 0)
        {
            EventLogInfo ev = EventLogProvider.GetEventLogInfo(eventId);
            if (ev != null)
            {
                sb.AppendLine();
                sb.Append(HttpUtility.HtmlDecode(EventLogHelper.GetEventText(ev)));
            }
        }

        return(sb.ToString());
    }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EventLogInfo GetEventLogModel(int EventLogID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 EventLogID,UserID,eMSG,eAppendTime,(select uName from tbUserInfo where UserID=tbEventLogInfo.UserID) UserName from tbEventLogInfo ");
            strSql.Append(" where EventLogID=@EventLogID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EventLogID", SqlDbType.Int, 4)
            };
            parameters[0].Value = EventLogID;

            EventLogInfo model = new EventLogInfo();
            DataSet      ds    = DbHelper.ExecuteDataset(CommandType.Text, strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["EventLogID"] != null && ds.Tables[0].Rows[0]["EventLogID"].ToString() != "")
                {
                    model.EventLogID = int.Parse(ds.Tables[0].Rows[0]["EventLogID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UserID"] != null && ds.Tables[0].Rows[0]["UserID"].ToString() != "")
                {
                    model.UserID = int.Parse(ds.Tables[0].Rows[0]["UserID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["eMSG"] != null && ds.Tables[0].Rows[0]["eMSG"].ToString() != "")
                {
                    model.eMSG = ds.Tables[0].Rows[0]["eMSG"].ToString();
                }
                if (ds.Tables[0].Rows[0]["eAppendTime"] != null && ds.Tables[0].Rows[0]["eAppendTime"].ToString() != "")
                {
                    model.eAppendTime = DateTime.Parse(ds.Tables[0].Rows[0]["eAppendTime"].ToString());
                }
                model.UserName = ds.Tables[0].Rows[0]["UserName"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #18
0
    /// <summary>
    /// Log event. Called when the "Log event" button is pressed.
    /// </summary>
    private bool LogEvent()
    {
        // Create new event object
        EventLogInfo newEvent = new EventLogInfo();

        // Set the properties
        newEvent.EventType        = "I";
        newEvent.EventDescription = "My new logged event.";
        newEvent.EventCode        = "APIEXAMPLE";
        newEvent.EventTime        = DateTime.Now;
        newEvent.Source           = "API Example";
        newEvent.SiteID           = CMSContext.CurrentSiteID;

        // Create new instance of event log provider
        EventLogProvider eventLog = new EventLogProvider();

        // Log the event
        eventLog.LogEvent(newEvent);

        return(true);
    }
Пример #19
0
        private IEnumerable <KeyValuePair <string, string> > GetMetricData()
        {
            string stringData = null;
            IEnumerable <KeyValuePair <string, string> > tupleData = null;

            // Gather data for each row, return special message if data is null
            switch (MetricCodeName)
            {
            // Categories
            case MetricDataEnum.support_metrics:
            case MetricDataEnum.support_metrics_system:
            case MetricDataEnum.support_metrics_environment:
            case MetricDataEnum.support_metrics_counters:
            case MetricDataEnum.support_metrics_ecommerce:
            case MetricDataEnum.support_metrics_tasks:
            case MetricDataEnum.support_metrics_eventlog:
                return(null);

                #region System

            case MetricDataEnum.support_metrics_system_version:
                stringData = CMSVersion.GetVersion(true, true, true, true);
                break;

            case MetricDataEnum.support_metrics_system_appname:
                stringData = SettingsHelper.AppSettings["CMSApplicationName"];
                break;

            case MetricDataEnum.support_metrics_system_instancename:
                stringData = SystemContext.InstanceName;
                break;

            case MetricDataEnum.support_metrics_system_physicalpath:
                stringData = SystemContext.WebApplicationPhysicalPath;
                break;

            case MetricDataEnum.support_metrics_system_apppath:
                stringData = SystemContext.ApplicationPath;
                break;

            case MetricDataEnum.support_metrics_system_uiculture:
                stringData = LocalizationContext.CurrentUICulture.CultureName;
                break;

            case MetricDataEnum.support_metrics_system_installtype:
                stringData = SystemContext.IsWebApplicationProject ? "Web App" : "Web site";
                break;

            case MetricDataEnum.support_metrics_system_portaltemplatepage:
                stringData = URLHelper.PortalTemplatePage;
                break;

            case MetricDataEnum.support_metrics_system_timesinceapprestart:
                stringData = (DateTime.Now - CMSApplication.ApplicationStart).ToString(@"dd\:hh\:mm\:ss");
                break;

            case MetricDataEnum.support_metrics_system_discoveredassemblies:
                tupleData = AssemblyDiscoveryHelper.GetAssemblies(true).Select((a, i) => GetKeyValuePair(i, a.FullName));
                break;

            case MetricDataEnum.support_metrics_system_targetframework:
                HttpRuntimeSection httpRuntime = ConfigurationManager.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
                stringData = httpRuntime.TargetFramework;
                break;

            case MetricDataEnum.support_metrics_system_authmode:
                AuthenticationSection Authentication = ConfigurationManager.GetSection("system.web/authentication") as AuthenticationSection;
                stringData = Authentication?.Mode.ToString();
                break;

            case MetricDataEnum.support_metrics_system_sessionmode:
                SessionStateSection SessionState = ConfigurationManager.GetSection("system.web/sessionState") as SessionStateSection;
                stringData = SessionState?.Mode.ToString();
                break;

            case MetricDataEnum.support_metrics_system_debugmode:
                CompilationSection Compilation = ConfigurationManager.GetSection("system.web/compilation") as CompilationSection;
                stringData = Compilation?.Debug.ToString();
                break;

            case MetricDataEnum.support_metrics_system_runallmanagedmodules:
                var xmlDoc = new System.Xml.XmlDocument();
                xmlDoc.Load(URLHelper.GetPhysicalPath("~/Web.config"));
                stringData = xmlDoc.SelectSingleNode("/configuration/system.webServer/modules").Attributes["runAllManagedModulesForAllRequests"]?.Value;
                break;

                #endregion System

                #region Environment

            case MetricDataEnum.support_metrics_environment_trustlevel:

                AspNetHostingPermissionLevel trustLevel = AspNetHostingPermissionLevel.None;

                if (!SystemContext.IsWebSite)
                {
                    trustLevel = AspNetHostingPermissionLevel.Unrestricted;
                }

                // Check the trust level by evaluation of levels
                foreach (AspNetHostingPermissionLevel permissionLevel in new[] {
                    AspNetHostingPermissionLevel.Unrestricted,
                    AspNetHostingPermissionLevel.High,
                    AspNetHostingPermissionLevel.Medium,
                    AspNetHostingPermissionLevel.Low,
                    AspNetHostingPermissionLevel.Minimal
                })
                {
                    try
                    {
                        new AspNetHostingPermission(permissionLevel).Demand();
                    }
                    catch (SecurityException)
                    {
                        continue;
                    }

                    trustLevel = permissionLevel;
                    break;
                }

                stringData = trustLevel.ToString();
                break;

            case MetricDataEnum.support_metrics_environment_iisversion:
                stringData = MetricServerVariables["SERVER_SOFTWARE"];
                break;

            case MetricDataEnum.support_metrics_environment_https:
                stringData = MetricServerVariables["HTTPS"];
                break;

            case MetricDataEnum.support_metrics_environment_windowsversion:
                using (RegistryKey versionKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
                {
                    var productName  = versionKey?.GetValue("ProductName");
                    var currentBuild = versionKey?.GetValue("CurrentBuild");
                    var releaseId    = versionKey?.GetValue("ReleaseId");

                    stringData = String.Format("{0}, build {1}, release {2}", productName.ToString(), currentBuild.ToString(), releaseId.ToString());
                }
                break;

            case MetricDataEnum.support_metrics_environment_netversion:
                using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"))
                {
                    var keyValue = ndpKey?.GetValue("Release");
                    if (keyValue != null)
                    {
                        var releaseKey = (int)keyValue;
                        if (releaseKey >= 461808)
                        {
                            stringData = "4.7.2 or later";
                        }
                        else
                        if (releaseKey >= 461308)
                        {
                            stringData = "4.7.1";
                        }
                        else
                        if (releaseKey >= 460798)
                        {
                            stringData = "4.7";
                        }
                        else
                        if (releaseKey >= 394802)
                        {
                            stringData = "4.6.2";
                        }
                        else
                        if (releaseKey >= 394254)
                        {
                            stringData = "4.6.1";
                        }
                        else
                        if (releaseKey >= 393295)
                        {
                            stringData = "4.6";
                        }
                        else
                        if (releaseKey >= 379893)
                        {
                            stringData = "4.5.2";
                        }
                        else
                        if (releaseKey >= 378675)
                        {
                            stringData = "4.5.1";
                        }
                        else
                        if (releaseKey >= 378389)
                        {
                            stringData = "4.5";
                        }
                    }
                }
                break;

            case MetricDataEnum.support_metrics_environment_sqlserverversion:
                var dtm = new TableManager(null);
                stringData = dtm.DatabaseServerVersion;
                break;

            case MetricDataEnum.support_metrics_environment_azure:
                var azureStats = new Dictionary <string, string>(4)
                {
                    { "Is a Cloud Service", (SettingsHelper.AppSettings["CMSAzureProject"] == "true").ToString("false") },
                    { "Is file system on Azure", (SettingsHelper.AppSettings["CMSExternalStorageName"] == "azure").ToString("false") },
                    { "Azure storage account", SettingsHelper.AppSettings["CMSAzureAccountName"] ?? String.Empty },
                    { "Azure CDN endpoint", SettingsHelper.AppSettings["CMSAzureCDNEndpoint"] ?? String.Empty }
                };

                tupleData = azureStats.Select(s => GetKeyValuePair(s.Key, s.Value));
                break;

            case MetricDataEnum.support_metrics_environment_amazon:
                var amazonStats = new Dictionary <string, string>(3)
                {
                    { "Is file system on Amazon", (SettingsHelper.AppSettings["CMSExternalStorageName"] == "amazon").ToString() },
                    { "Amazon bucket name", SettingsHelper.AppSettings["CMSAmazonBucketName"] ?? String.Empty },
                    { "Amazon public access", SettingsHelper.AppSettings["CMSAmazonPublicAccess"] ?? String.Empty },
                };

                tupleData = amazonStats.Select(s => GetKeyValuePair(s.Key, s.Value));
                break;

            case MetricDataEnum.support_metrics_environment_services:
                tupleData = ServiceManager.GetServices().Select(s => GetKeyValuePair(s.ServiceName, s.Status));
                break;

                #endregion Environment

                #region Counters

            case MetricDataEnum.support_metrics_counters_webfarmservers:
                stringData = CoreServices.WebFarm.GetEnabledServerNames().Count().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_stagingservers:
                stringData = ServerInfoProvider.GetServers().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_pagemostchildren:
                CMS.DocumentEngine.TreeProvider tree = new CMS.DocumentEngine.TreeProvider();

                var pageWithMostChildren = tree.SelectNodes().OnCurrentSite().Published()
                                           .ToDictionary(n => n, n => n.Children.Count)
                                           .Aggregate((l, r) => l.Value > r.Value ? l : r);

                tupleData = new[] { GetKeyValuePair(URLHelper.GetAbsoluteUrl("~" + pageWithMostChildren.Key.NodeAliasPath), pageWithMostChildren.Value) };
                break;

            case MetricDataEnum.support_metrics_counters_modules:
                stringData = ResourceInfoProvider.GetResources().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_medialibraries:
                stringData = MediaLibraryInfoProvider.GetMediaLibraries().WhereNull("LibraryGroupID").GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_activities:
                stringData = ActivityInfoProvider.GetActivities().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_contacts:
                stringData = ContactInfoProvider.GetContacts().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_contactgroups:
                stringData = ContactGroupInfoProvider.GetContactGroups().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_omrules:
                stringData = RuleInfoProvider.GetRules().GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_counters_products:
                stringData = SKUInfoProvider.GetSKUs(SiteContext.CurrentSiteID).WhereNull("SKUOptionCategoryID").GetCount().ToString();
                break;

                #endregion Counters

                #region Tasks

            case MetricDataEnum.support_metrics_tasks_webfarm:
                stringData = WebFarmTaskInfoProvider.GetWebFarmTasks()
                             .WhereLessThan("TaskCreated", DateTime.Now.AddDays(-1))
                             .GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_tasks_staging:
                stringData = StagingTaskInfoProvider.GetTasks()
                             .WhereLessThan("TaskTime", DateTime.Now.AddDays(-1))
                             .GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_tasks_integration:
                stringData = IntegrationTaskInfoProvider.GetIntegrationTasks()
                             .WhereLessThan("TaskTime", DateTime.Now.AddDays(-1))
                             .GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_tasks_scheduled:
                stringData = TaskInfoProvider.GetTasks()
                             .WhereTrue("TaskDeleteAfterLastRun")
                             .WhereLessThan("TaskNextRunTime", DateTime.Now.AddDays(-1))
                             .GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_tasks_search:
                stringData = SearchTaskInfoProvider.GetSearchTasks()
                             .WhereLessThan("SearchTaskCreated", DateTime.Now.AddDays(-1))
                             .GetCount().ToString();
                break;

            case MetricDataEnum.support_metrics_tasks_email:
                stringData = EmailInfoProvider.GetEmailCount("EmailStatus = 1 AND EmailLastSendResult IS NOT NULL").ToString();
                break;

                #endregion Tasks

                #region Event log

            case MetricDataEnum.support_metrics_eventlog_macroerrors:
                var macroErrors = EventLogProvider.GetEvents()
                                  .WhereEquals("Source", "MacroResolver")
                                  .WhereGreaterThan("EventTime", DateTime.Now.Subtract(TimeSpan.FromDays(7)))
                                  .OrderByDescending("EventTime")
                                  .TopN(10);

                tupleData = macroErrors.Select(e =>
                                               GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                               e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                               );
                break;

            case MetricDataEnum.support_metrics_eventlog_stagingerrors:
                var stagingErrors = EventLogProvider.GetEvents()
                                    .WhereEquals("Source", "staging")
                                    .WhereIn("EventType", new[] { "E", "W" })
                                    .WhereGreaterThan("EventTime", DateTime.Now.Subtract(TimeSpan.FromDays(7)))
                                    .OrderByDescending("EventTime")
                                    .TopN(10);

                tupleData = stagingErrors.Select(e =>
                                                 GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                                 e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                                 );
                break;

            case MetricDataEnum.support_metrics_eventlog_searcherrors:
                var searchErrors = EventLogProvider.GetEvents()
                                   .WhereEquals("Source", "search")
                                   .WhereIn("EventType", new[] { "E", "W" })
                                   .WhereGreaterThan("EventTime", DateTime.Now.Subtract(TimeSpan.FromDays(7)))
                                   .OrderByDescending("EventTime")
                                   .TopN(10);

                tupleData = searchErrors.Select(e =>
                                                GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                                e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                                );
                break;

            case MetricDataEnum.support_metrics_eventlog_contenterrors:
                var contentErrors = EventLogProvider.GetEvents()
                                    .WhereEquals("Source", "content")
                                    .WhereIn("EventType", new[] { "E", "W" })
                                    .WhereGreaterThan("EventTime", DateTime.Now.Subtract(TimeSpan.FromDays(7)))
                                    .OrderByDescending("EventTime")
                                    .TopN(10);

                tupleData = contentErrors.Select(e =>
                                                 GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                                 e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                                 );
                break;

            case MetricDataEnum.support_metrics_eventlog_exceptions:
                var exceptions = EventLogProvider.GetEvents()
                                 .WhereEquals("EventCode", "exception")
                                 .WhereGreaterThan("EventTime", DateTime.Now.Subtract(TimeSpan.FromDays(7)))
                                 .OrderByDescending("EventTime")
                                 .TopN(10);

                tupleData = exceptions.Select(e =>
                                              GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                              e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                              );
                break;

            case MetricDataEnum.support_metrics_eventlog_upgrade:

                EventLogInfo upgrade = EventLogProvider.GetEvents().WhereLike("Source", "upgrade%").FirstOrDefault();
                var          version = upgrade?.Source.Split(' ')[2];

                if (!String.IsNullOrEmpty(version))
                {
                    var parameters = new QueryDataParameters
                    {
                        { "@versionnumber", version }
                    };

                    var events = ConnectionHelper.ExecuteQuery("SupportHelper.CustomMetric.checkupgrade", parameters);

                    tupleData = (from DataRow row in events.Tables[0]?.Rows select row)
                                .Select(r => new EventLogInfo(r)).Select(e =>
                                                                         GetKeyValuePair(String.Format("{0} from {1} at {2} in {3}", e.EventCode, e.Source, e.EventTime, e.EventMachineName),
                                                                                         e.EventDescription.Length > CUTOFF ? e.EventDescription.Substring(0, CUTOFF) : e.EventDescription)
                                                                         );
                }
                break;

                #endregion Event log
            }

            if (tupleData?.Count() > 0)
            {
                return(tupleData);
            }

            if (stringData != null)
            {
                return(new[] { GetKeyValuePair(0, stringData) });
            }

            return(new[] { GetKeyValuePair(0, ResHelper.GetStringFormat("support.metrics.invalid", MetricDisplayName, MetricCodeName)) });
        }
    /// <summary>
    /// Gets and updates abuse report. Called when the "Get and update report" button is pressed.
    /// Expects the LogEvent method to be run first.
    /// </summary>
    private bool GetAndUpdateEvent()
    {
        // Get top 1 event matching the where condition
        string where = "EventCode = 'APIEXAMPLE'";
        int topN = 1;
        DataSet events = EventLogProvider.GetAllEvents(where, null, topN, null);

        if (!DataHelper.DataSourceIsEmpty(events))
        {
            // Create the object from DataRow
            EventLogInfo updateEvent = new EventLogInfo(events.Tables[0].Rows[0]);

            // Update the properties
            updateEvent.EventDescription = updateEvent.EventDescription.ToLower();

            // Save the changes
            EventLogProvider.SetEventLogInfo(updateEvent);

            return true;
        }

        return false;
    }
Пример #21
0
 private string GetLogEventBrief(EventLogInfo record)
 {
     return($"{record.EventCode} | {record.EventDescription} | {record.EventUrl} | {record.Exception?.ToString() ?? "<no exception>"}");
 }
Пример #22
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static bool UpdateEventLog(EventLogInfo model)
 {
     return(DatabaseProvider.GetInstance().UpdateEventLog(model));
 }
Пример #23
0
        private void LogTransaction(Logger logger, decimal shares, decimal totalShares, DateTime date, decimal stockPrice, decimal stock, decimal cash, EventLogInfo eventLogInfo)
        {
            logger.LogInfo("Transaction : " + date.Month.ToString() + "/" + date.Day.ToString() + "/" + date.Year.ToString());
            logger.LogInfo("Stock Price : " + stockPrice.ToString("C"));

            if (eventLogInfo.RebalanceFlagged)
            {
                logger.LogInfo("Rebalance flagged for next buy");
            }

            if (eventLogInfo.RebalanceTriggered)
            {
                logger.LogInfo("Rebalance required");
                logger.LogInfo("Share purchase increased by " + eventLogInfo.AdjustedSharesForRebalance.ToString("0.##"));
                logger.LogInfo("Rebalance corrected");
            }

            if (eventLogInfo.CashShort)
            {
                logger.LogWarn("Insufficient Cash Requested: " + eventLogInfo.CashRequestedForCashShort.ToString("C") + " Current: " + eventLogInfo.CashAvailableForCashShort.ToString("C"));
                logger.LogWarn("Share purchase decreased by " + eventLogInfo.AdjustedSharesForCashShort.ToString("0.##"));
            }

            if (shares != 0)
            {
                decimal adjustedShares = (shares > 0) ? shares : -shares;
                logger.LogInfo(((shares > 0) ? "Bought " : "Sold ") + adjustedShares.ToString("0.##") + " shares");
                logger.LogInfo("Total Shares: " + totalShares.ToString("0.##"));
                logger.LogInfo("Total Stock: " + stock.ToString("C") + " (" + (stock / (stock + cash)).ToString("P") + ")");
                logger.LogInfo("Total Cash: " + cash.ToString("C") + " (" + (cash / (stock + cash)).ToString("P") + ")");
                logger.LogInfo("Total Assets: " + (stock + cash).ToString("C"));
            }

            logger.LogInfo("");
        }
Пример #24
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int AddEventLog(EventLogInfo model)
 {
     return(DatabaseProvider.GetInstance().AddEventLog(model));
 }
Пример #25
0
        public void Add(Logger logger, DateTime date, decimal stockPrice, decimal shares)
        {
            if (stockPrice > 0)
            {
                EventLogInfo eventLogInfo = new EventLogInfo();

                // Update the stock value to the current price
                StockValue = StockShares * stockPrice;

                if (m_CurrentYear != date.Year)
                {
                    m_YearlyBalances.Add(StockValue + m_CashBalance);
                    m_CurrentYear = date.Year;
                }

                decimal transactionCost = stockPrice * shares;

                if (shares < 0)
                {
                    // Sell
                    m_CashBalance -= transactionCost;
                    StockShares   += shares;
                    StockValue     = StockShares * stockPrice;

                    if (m_CashBalance >= (m_RebalanceRatio * (StockValue + m_CashBalance)))
                    {
                        m_RebalanceRequired = true;
                        eventLogInfo.CreateRebalanceFlagged();
                        //logger.LogInfo("Rebalance flagged for next buy");
                        ++m_TotalRebalancesRequired;
                    }
                }
                else if (shares > 0)
                {
                    // Buy

                    if (m_RebalanceRequired)
                    {
                        // We have excess cash, so adjust the buy order so that we are rebalanced
                        //logger.LogInfo("Rebalance required");

                        decimal sharesAdjustedBy = 0;
                        decimal targetCash       = (StockValue + m_CashBalance) * (1 - m_TargetRatio);
                        if ((m_CashBalance - transactionCost) > targetCash)
                        {
                            decimal adjustedShares = targetCash / stockPrice;
                            sharesAdjustedBy = adjustedShares - shares;
                            //logger.LogInfo("Share purchase increased by " + (adjustedShares - shares).ToString("0.##"));
                            shares          = adjustedShares;
                            transactionCost = targetCash;
                        }
                        m_RebalanceRequired = false;
                        //logger.LogInfo("Rebalance corrected");
                        eventLogInfo.CreateRebalanceTriggered(sharesAdjustedBy);
                        ++m_TotalRebalancesExecutes;
                    }

                    if (m_CashBalance <= transactionCost)
                    {
                        // We do not have enough cash to purchases the requested amount of stock
                        //logger.LogInfo("*Insufficient Cash* Requested: " + transactionCost.ToString("C") + " Current: " + m_CashBalance.ToString("C"));
                        decimal adjustedShares   = m_CashBalance / stockPrice;
                        decimal sharesAdjustedBy = (m_CashBalance > 0) ? shares - adjustedShares : 0;
                        //logger.LogInfo("Share purchase decreased by " + (shares - adjustedShares).ToString("0.##"));
                        eventLogInfo.CreateCashShort(transactionCost, m_CashBalance, sharesAdjustedBy);
                        shares          = adjustedShares;
                        transactionCost = m_CashBalance;
                        ++m_TotalCashShorts;
                    }
                    m_CashBalance -= transactionCost;
                    StockShares   += shares;
                    StockValue     = StockShares * stockPrice;
                }

                LogTransaction(logger, shares, StockShares, date, stockPrice, StockValue, m_CashBalance, eventLogInfo);
            }
        }
    /// <summary>
    /// Log event. Called when the "Log event" button is pressed.
    /// </summary>
    private bool LogEvent()
    {
        // Create new event object
        EventLogInfo newEvent = new EventLogInfo();

        // Set the properties
        newEvent.EventType = "I";
        newEvent.EventDescription = "My new logged event.";
        newEvent.EventCode = "APIEXAMPLE";
        newEvent.EventTime = DateTime.Now;
        newEvent.Source = "API Example";
        newEvent.SiteID = CMSContext.CurrentSiteID;

        // Create new instance of event log provider
        EventLogProvider eventLog = new EventLogProvider();

        // Log the event
        eventLog.LogEvent(newEvent);

        return true;
    }
Пример #27
0
 public static bool Update(EventLogInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <EventLogInfo>(entity));
 }