コード例 #1
0
ファイル: LogCatcher.cs プロジェクト: dchaves80/dispe
        public static void AddLog(string Message, string stack, DotNetNuke.Entities.Modules.PortalModuleBase Module, System.Web.SessionState.HttpSessionState SS)
        {
            ELP = new DotNetNuke.Services.Log.EventLog.EventLogController();
            DotNetNuke.Services.Log.EventLog.LogTypeInfo LT = new DotNetNuke.Services.Log.EventLog.LogTypeInfo();
            LT.LogTypeDescription  = "Error en sistema...";
            LT.LogTypeFriendlyName = "Error en sistema...";
            LT.LogTypeKey          = "Dispensario";
            LT.LogTypeOwner        = "Administrador";

            DotNetNuke.Services.Log.EventLog.LogInfo LI = new DotNetNuke.Services.Log.EventLog.LogInfo();
            if (Module != null)
            {
                LI.LogPortalID = Module.PortalId;
                LI.LogUserID   = Module.UserId;
                LI.AddProperty("Usuario:", Module.UserInfo.Username);
            }
            else
            {
                LI.LogPortalID = 0;
                LI.LogUserID   = 1;
                LI.AddProperty("FromWebservice", "0000");
            }
            LI.LogTypeKey = "Dispensario";

            LI.AddProperty("Error", Message);
            LI.AddProperty("Stack", stack);

            if (SS != null)
            {
                for (int a = 0; a < SS.Count; a++)
                {
                    System.Web.Script.Serialization.JavaScriptSerializer JSC = new System.Web.Script.Serialization.JavaScriptSerializer();
                    string serializationtype = SS[a].GetType().Name;

                    string serialization = "";
                    //MAPA DE SERIALIZACIONES Y CASTEOS

                    if (serializationtype == "Paciente")
                    {
                        serialization = JSC.Serialize(SS[a] as Modelos.Paciente);
                    }
                    if (serializationtype == "String")
                    {
                        serialization = JSC.Serialize(SS[a] as String);
                    }

                    if (serialization == "")
                    {
                        serialization = "No se pudo serializar";
                    }



                    LI.AddProperty("From session Nro. " + a.ToString() + " and key " + SS.Keys[a] + " type [" + serializationtype + "] ", serialization);
                }
            }
            LI.BypassBuffering = true;

            ELP.AddLog(LI);
        }
コード例 #2
0
        /// <summary>
        /// 载入提示信息(带提交)
        /// </summary>
        /// <param name="key"></param>
        /// <param name="__MsgType"></param>
        public void LoadMessage(String key, EnumTips __MsgType, DotNetNuke.Entities.Modules.PortalModuleBase Pmb, params object[] args)
        {
            _MsgType = __MsgType;

            key = key.Replace(".Message", "");

            _Content = Localization.GetString(String.Format("{0}.Message", key), Localization.GetResourceFile(Pmb, "Message.ascx.resx"));
            if (!String.IsNullOrEmpty(_Content) && args != null && args.Length > 0)
            {
                _Content = String.Format(_Content, args);
            }
            Put();
        }
コード例 #3
0
 /// <summary>
 ///  载入提示信息(带提交)
 /// </summary>
 /// <param name="key"></param>
 /// <param name="__MsgType"></param>
 public void LoadMessage(String key, EnumTips __MsgType, DotNetNuke.Entities.Modules.PortalModuleBase Pmb)
 {
     _MsgType = __MsgType;
     LoadMessage(key, _MsgType, Pmb, new String[] { "" });
 }
コード例 #4
0
 /// <summary>
 /// 载入提示信息(带提交)
 /// </summary>
 /// <param name="pmb"></param>
 /// <param name="key"></param>
 public void LoadMessage(String key, DotNetNuke.Entities.Modules.PortalModuleBase Pmb, params object[] args)
 {
     LoadMessage(key, _MsgType, Pmb, args);
 }
コード例 #5
0
 /// <summary>
 /// 向页面注册提示信息
 /// </summary>
 public String Post(DotNetNuke.Entities.Modules.PortalModuleBase Pmb)
 {
     return(Post(Pmb.Page));
 }
コード例 #6
0
ファイル: BaseAdmin.cs プロジェクト: robsiera/NBrightDNN
        public new string EditUrl(string KeyName, string KeyValue, string ControlKey, string[] AdditionalParameters)
        {
            var objBase = new DotNetNuke.Entities.Modules.PortalModuleBase();
            var skinSrc = Globals.QueryStringEncode(Utils.RequestQueryStringParam(Context, "SkinSrc"));
            var key     = ControlKey;

            if ((string.IsNullOrEmpty(key)))
            {
                key = "Edit";
            }

            var tempList = new Dictionary <String, String>();

            tempList.Add("mid", Convert.ToString(ModuleId));

            if (!string.IsNullOrEmpty(KeyName) & !string.IsNullOrEmpty(KeyValue))
            {
                tempList.Add(KeyName.ToLower(), KeyValue);
            }

            if (!string.IsNullOrEmpty(skinSrc))
            {
                tempList.Add("SkinSrc", skinSrc);
            }

            for (int i = 0; i <= AdditionalParameters.Length - 1; i++)
            {
                tempList.Add(AdditionalParameters[i].Split('=')[0].ToLower(), AdditionalParameters[i].Split('=')[1]);
            }

            // build array to pass as param
            var paramlist = new string[tempList.Keys.Count];
            var lp        = 0;

            foreach (var t in tempList)
            {
                paramlist[lp] = t.Key + "=" + t.Value;
                lp           += 1;
            }

            var targetUrl = "";

            if (String.IsNullOrEmpty(OverrideEditUrlBase))
            {
                targetUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, key, paramlist);
            }
            else
            {
                targetUrl = OverrideEditUrlBase;
                // add controlkey to the list
                targetUrl += targetUrl.Contains("?") ? "&" : "?";
                targetUrl += "ctl=" + key;
                // add other params
                foreach (var s in paramlist)
                {
                    targetUrl += "&" + s;
                }
            }

            return(targetUrl);
        }