Пример #1
0
        public void ShowMessage(string msg, MerchantTribe.Commerce.Content.DisplayMessageType msgType)
        {
            this.pnlMain.Visible = true;
            HtmlGenericControl li = new HtmlGenericControl("li");

            li.Attributes.Add("class", "errorline");
            HtmlGenericControl icondiv = new HtmlGenericControl("div");

            li.Controls.Add(icondiv);
            icondiv.Attributes.Add("class", "icon");
            Image img = new Image();

            img.ImageUrl = GetIconType(msgType);
            icondiv.Controls.Add(img);

            HtmlGenericControl divMessage = new HtmlGenericControl("div");

            divMessage.Attributes.Add("class", "message");

            Label MessageLabel = new Label();

            MessageLabel.Text = msg;
            divMessage.Controls.Add(MessageLabel);

            li.Controls.Add(divMessage);
            this.MessageList.Controls.Add(li);
        }
Пример #2
0
        public void ShowMessage(string msg, MerchantTribe.Commerce.Content.DisplayMessageType msgType)
        {
            this.litMain.Text += "<div class=\"";
            switch (msgType)
            {
            case DisplayMessageType.Error:
                this.litMain.Text += "flash-message-error";
                break;

            case DisplayMessageType.Exception:
                this.litMain.Text += "flash-message-exception";
                break;

            case DisplayMessageType.Information:
                this.litMain.Text += "flash-message-info";
                break;

            case DisplayMessageType.Question:
                this.litMain.Text += "flash-message-question";
                break;

            case DisplayMessageType.Success:
                this.litMain.Text += "flash-message-success";
                break;

            case DisplayMessageType.Warning:
                this.litMain.Text += "flash-message-warning";
                break;

            case DisplayMessageType.Minor:
                this.litMain.Text += "flash-message-minor";
                break;
            }

            this.litMain.Text += "\">" + msg + "</div>";
        }