Exemplo n.º 1
0
        protected string ShowMessage()
        {
            string s = string.Empty;

            if (Cookies.GetValue("message") != string.Empty)
            {
                s += "<dl id=\"system-message\">";
                s += "<dd class=\"message message\"><ul>";
                s += "<li>" + Data.Base64Decode(Cookies.GetValue("message")) + "</li>";
                s += "</ul></dd>";
                s += "</dl>";

                Cookies.Remove("message");
            }
            else
            {
                Message _Message = CPViewPage.Message;

                if (_Message != null && _Message.ListMessage.Count > 0)
                {
                    s += "<dl id=\"system-message\">";
                    s += "<dd class=\"message " + _Message.MessageTypeName + "\"><ul>";
                    for (int i = 0; i < _Message.ListMessage.Count; i++)
                    {
                        s += "<li>" + _Message.ListMessage[i] + "</li>";
                    }
                    s += "</ul></dd>";
                    s += "</dl>";
                }
            }

            return(s);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 从缓存中删除辅助状态
        /// </summary>
        public static void RemoveCurrentUserBrowserStatus()
        {
            String cookieUserName = Cookies.GetValue(BROWSER_STATUS_COOKIE_NAME);

            if (!String.IsNullOrEmpty(cookieUserName))
            {
                Cookies.Remove(BROWSER_STATUS_COOKIE_NAME);
            }
        }
Exemplo n.º 3
0
        protected string ShowMessage()
        {
            var html = string.Empty;

            var result = html;

            if (Cookies.GetValue("message") != string.Empty)
            {
                html += @"<div class=""card-block"">
                            <div class=""alert alert-icon alert-white alert-success alert-dismissible fade show"" role=""alert""><i class=""fa fa-check""></i>" + Data.Base64Decode(Cookies.GetValue("message")) + @"</div>
                        </div>";

                Cookies.Remove("message");
            }
            else
            {
                var message = CPViewPage.Message;

                if (message == null || message.ListMessage.Count <= 0)
                {
                    return(html);
                }

                string classValue = ""; string icon = "";
                if (message.MessageTypeName == "error")
                {
                    classValue = "alert-danger";
                    icon       = "fa-times-circle";
                }
                else if (message.MessageTypeName == "notice")
                {
                    classValue = "alert-info";
                    icon       = "fa-exclamation-circle";
                }
                else
                {
                    classValue = "alert-success";
                    icon       = "fa-check";
                }

                foreach (var m in message.ListMessage)
                {
                    result = result + "<div class=\"alert alert-icon alert-white " + classValue + " alert-dismissible fade show\" role=\"alert\"><i class=\"fa " + icon + "\"></i><strong>Thông báo!</strong> " + m + ".</div>";
                }

                html += @"  <div class=""card-block"">
                                " + result + @"
                            </div>";
            }

            return(html);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 向缓存中写入当前用户辅助状态
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="permission">用户权限</param>
        /// <param name="unreadMailCount">未读邮件数量</param>
        public static void SetCurrentUserBrowserStatus(String userName, PermissionType permission, Int32 unreadMailCount)
        {
            String cookieBrowserStatus = Cookies.GetValue(BROWSER_STATUS_COOKIE_NAME);

            String newUserName       = userName;
            String newUserPermission = ((Int32)permission).ToString();
            String newUserUnReadMail = unreadMailCount.ToString();
            String newBrowserStatus  = String.Format("{0}|{1}|{2}", newUserName, newUserPermission, newUserUnReadMail);

            if (!String.Equals(newBrowserStatus, cookieBrowserStatus, StringComparison.OrdinalIgnoreCase))
            {
                Cookies.SetValue(BROWSER_STATUS_COOKIE_NAME, newBrowserStatus, false);
            }
        }
Exemplo n.º 5
0
        public CPViewPage()
        {
            string lang_code = Cookies.GetValue("CP.Lang", true);

            //ngon ngu mac dinh neu chua co
            if (lang_code == string.Empty)
            {
                lang_code = "vi-VN";
            }

            CurrentLang      = new SysLangEntity();
            CurrentLang.Code = lang_code;

            ResourceService = new IniResourceService(Server.MapPath("~/" + HL.Core.Web.Setting.Sys_CPDir + "/Views/Lang/" + lang_code + ".ini"));
        }
Exemplo n.º 6
0
        public string ShowMessage()
        {
            var html = string.Empty;

            var result = html;

            if (Cookies.GetValue("message") != string.Empty)
            {
                html += @"<div class=""note note-info"">
                            <p>" + Data.Base64Decode(Cookies.GetValue("message")) + @"</p>
                        </div>";

                Cookies.Remove("message");
            }
            else
            {
                var message = Message;

                if (message == null || message.ListMessage.Count <= 0)
                {
                    return(html);
                }

                var classValue = message.MessageTypeName == "error" ? "note-danger" : "note-info";

                foreach (var m in message.ListMessage)
                {
                    result = result + "<p>" + m + "</p>";
                }

                html += @"  <div class=""note " + classValue + @""">
                                " + result + @"
                            </div>";
            }

            return(html);
        }