示例#1
0
        /// <summary>
        /// write a LogItem in logItems table
        /// </summary>
        /// <param name="module">current module</param>
        /// <param name="description">the event log description</param>
        /// <param name="type">the event log type. default TracerItemType.Info</param>
        public static void Write(PigeonCms.Module module, string description, TracerItemType type)
        {
            if (module.UseLog == Utility.TristateBool.True ||
                (module.UseLog == Utility.TristateBool.NotSet && LogProvider.AppUseLog))
            {
                var item = new LogItem();
                var man = new LogItemsManager();

                item.ModuleId = module.Id;
                item.Type = type;
                try
                {
                    //sometimes throw NullReferenceException
                    item.UserHostAddress = HttpContext.Current.Request.UserHostAddress;
                }
                catch { }
                try
                {
                    //sometimes throw NullReferenceException
                    item.SessionId = HttpContext.Current.Session.SessionID;
                }
                catch { }
                //item.Url = HttpContext.Current.Request.RawUrl;    //parte finale
                item.Url = Utility.Html.GetTextPreview(HttpContext.Current.Request.Url.AbsoluteUri, 495, ""); //all url
                item.Description = Utility.Html.GetTextPreview(description, 495, "");

                man.Insert(item);
            }
        }
示例#2
0
    private void editRow(int recordId)
    {
        var obj = new LogItem();
        LblOk.Text = "";
        LblErr.Text = "";

        clearForm();
        base.CurrentId = recordId;

        if (base.CurrentId == 0)
        { }
        else
        {
            obj = new LogItemsManager().GetByKey(base.CurrentId);
            obj2form(obj);
        }
        MultiView1.ActiveViewIndex = 1;
    }