using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HySoft.BaseCallCenter.Web.tools
{
    public partial class BasePage : System.Web.UI.Page
    {
        /// <summary>
        /// 父类的构造函数
        /// </summary>
        public BasePage()
        {

        }

        #region 通用方法========================================================

        #endregion

        #region JS提示============================================

        /// <summary>
        /// 添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式(Success、Warn、Error)</param>
        protected void JscriptMsg(string msgtitle, string url, string msgcss)
        {
            string msbox = "top.jsprint(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\")";
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }
        /// <summary>
        /// 添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式(Success、Warn、Error)</param>
        protected void JscriptMsg(string msgtitle, string url, string msgcss,bool reload)
        {
            string msbox = "top.jsprint(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\");parent.reload();";
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }
        /// <summary>
        /// 带回传函数的添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式(Success、Warn、Error)</param>
        /// <param name="callback">JS回调函数</param>
        protected void JscriptMsg(string msgtitle, string url, string msgcss, string callback)
        {
            string msbox = "top.jsprint(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\", " + callback + ")";
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }

        /// <summary>
        /// 添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式(Success、Warn、Error)</param>
        protected void SelfJscriptMsg(string msgtitle, string url, string msgcss)
        {
            string msbox = "jsprint(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\")";
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }

        /// <summary>
        /// 带回传函数的添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式(Success、Warn、Error)</param>
        /// <param name="callback">JS回调函数</param>
        protected void SelfJscriptMsg(string msgtitle, string url, string msgcss, string callback)
        {
            string msbox = "jsprint(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\", " + callback + ")";
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }
        #endregion
    }
}