Exemple #1
0
    /// <summary>
    /// 设置键值,并更新缓存
    /// </summary>
    /// <param name="Key"></param>
    /// <param name="Value"></param>
    public static void SetString(string Key, string Value)
    {
        var bll   = new Sys.BLL.SysConfig();
        var model = new Sys.Model.SysConfig();

        model       = bll.GetModel("WebConfig", Key);
        model.Value = Value;
        bll.Update(model);
        DataCache.RemoveCache("SysConfigValue-WebConfig-" + Key);
    }
Exemple #2
0
    private void ConfigSave()
    {
        ManageHelper.CheckAdminPower("system_configsystemupdate");

        var bll   = new Sys.BLL.SysConfig();
        var model = new Sys.Model.SysConfig();


        var json = Request["data"];
        var rows = (ArrayList)PluSoft.Utils.JSON.Decode(json);

        foreach (Hashtable row in rows)
        {
            model       = bll.GetModel("WebConfig", "WebsiteName");
            model.Value = row["WebsiteName"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-WebsiteName");

            model       = bll.GetModel("WebConfig", "WebsiteUrl");
            model.Value = row["WebsiteUrl"].ToString();

            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-WebsiteUrl");

            model       = bll.GetModel("WebConfig", "PageHeadTitle");
            model.Value = row["PageHeadTitle"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadTitle");

            model       = bll.GetModel("WebConfig", "PageHeadMetaKeywords");
            model.Value = row["PageHeadMetaKeywords"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadMetaKeywords");


            model       = bll.GetModel("WebConfig", "PageHeadMetaDescription");
            model.Value = row["PageHeadMetaDescription"].ToString();
            bll.Update(model);
            ManageHelper.AddLog("system_configsystemupdate", "修改了系统配置");
            DataCache.RemoveCache("SysConfigValue-WebConfig-PageHeadMetaDescription");
        }

        Response.Write("yes");
        Response.End();
    }
Exemple #3
0
    public string CurPageFlag = "system_adminipblockconfig";          //当前模块权限
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();

        ManageHelper.CheckAdminPower(CurPageFlag);
        var bll = new Sys.BLL.SysConfig();

        if (ManageHelper.PageAct() == "save")
        {
            ManageHelper.CheckAdminPower("system_memberipblockconfigupdate");//修改权限
            var model = bll.GetModel("WebConfig", "AdminIpBlockType");
            model.Value = PageRequest.GetString("IpBlockType");
            bll.Update(model);
            //添加日志
            ManageHelper.AddLog(CurPageFlag, (BlockModule == 0 ? "后台" : "用户") + "访问限制选项修改为:“" + Sys.BLL.SysConfig.GetNameByCache("IpBlockType", PageRequest.GetString("IpBlockType")) + "”");

            Response.Write("yes");
            Response.End();
        }
    }
Exemple #4
0
    private void ConfigSave()
    {
        ManageHelper.CheckAdminPower("system_configemailupdate");
        var bll   = new Sys.BLL.SysConfig();
        var model = new Sys.Model.SysConfig();
        var json  = Request["data"];
        var rows  = (ArrayList)PluSoft.Utils.JSON.Decode(json);



        foreach (Hashtable row in rows)
        {
            model       = bll.GetModel("WebConfig", "EmailServer");
            model.Value = row["EmailServer"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailServer");

            model       = bll.GetModel("WebConfig", "EmailPort");
            model.Value = row["EmailPort"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailPort");

            model       = bll.GetModel("WebConfig", "EmailAccount");
            model.Value = row["EmailAccount"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailAccount");

            model       = bll.GetModel("WebConfig", "EmailPassword");
            model.Value = row["EmailPassword"].ToString();
            bll.Update(model);
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailPassword");

            model       = bll.GetModel("WebConfig", "EmailSender");
            model.Value = row["EmailSender"].ToString();
            bll.Update(model);
            ManageHelper.AddLog("system_configemailupdate", "修改了邮件设置");
            DataCache.RemoveCache("SysConfigValue-WebConfig-EmailSender");
        }
        Response.Write("yes");
        Response.End();
    }
Exemple #5
0
    /// <summary>
    /// 获得管理端风格
    /// </summary>
    /// <returns></returns>
    public static string GetTheme()
    {
        string theme = Utils.GetCookie("manage_Theme");

        if (theme == "")
        {
            var bllConfig = new Sys.BLL.SysConfig();
            List <Sys.Model.SysConfig> listTheme = bllConfig.GetListByCache("ManageTheme", 1);
            if (listTheme.Count == 0)
            {
                theme = "blue";
            }
            else
            {
                theme = listTheme[0].Value;
            }
            //Cookie保存
            //518400年 43200月 1440天
            Utils.WriteCookie("manage_Theme", theme, 518400, ConfigHelper.GetConfigString("CookieDomain"));
        }
        return(theme);
    }