Exemple #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <returns></returns>
        public static bool SaveConfig(AlbumConfigInfo albumconfiginfo)
        {
            AlbumConfigFileManager acfm = new AlbumConfigFileManager();

            AlbumConfigFileManager.ConfigInfo = albumconfiginfo;
            return(acfm.SaveConfig());
        }
Exemple #2
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static AlbumConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (AlbumConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(AlbumConfigInfo));
 }
        protected void SaveCombinationInfo_Click(object sender, EventArgs e)
        {
            #region 保存相册配置
            config.Enablealbum = int.Parse(EnableAlbum.SelectedValue);
            GeneralConfigs.Serialiaze(config, Server.MapPath("../../config/general.config"));
            if (Utils.IsNumeric(maxalbumcount.Text.ToString()) == true && Utils.IsInt(maxalbumcount.Text.ToString()) == true)
            {
                if (config.Enablealbum == 1)
                {
                    AlbumConfigInfo albumconfiginfo = new AlbumConfigInfo();
                    albumconfiginfo.MaxAlbumCount = maxalbumcount.Text;
                    AlbumConfigs.SaveConfig(albumconfiginfo);
                    //保存组照片最大空间
                    DataTable dt = DatabaseProvider.GetInstance().GetUserGroupMaxspacephotosize();
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (!Utils.IsInt(DNTRequest.GetString("maxspacephotosize" + dr["groupid"].ToString()).ToString()))
                        {
                            base.RegisterStartupScript("", "<script>alert('输入错误,相册大小只能是0或者正整数');window.location.href='album_config.aspx';</script>");
                            return;
                        } 
                        int photosize = DNTRequest.GetInt("maxspacephotosize" + dr["groupid"].ToString(), 0);
                        Discuz.Entity.UserGroupInfo __usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(Convert.ToInt32(dr["groupid"].ToString()));
                        __usergroupinfo.Maxspacephotosize = photosize;
                        AdminUserGroups.UpdateUserGroupInfo(__usergroupinfo);
                    }
                }
                Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                Response.Redirect("album_config.aspx");
            }
            else
            {

                base.RegisterStartupScript("", "<script>alert('相册数上限输入错误,请检查');window.location.href='album_config.aspx';</script>");
                return;
            }
            #endregion
        }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static AlbumConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo = (AlbumConfigInfo) DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(AlbumConfigInfo));
 }
Exemple #5
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <returns></returns>
 public static bool SaveConfig(AlbumConfigInfo albumconfiginfo)
 {
     AlbumConfigFileManager acfm = new AlbumConfigFileManager();
     AlbumConfigFileManager.ConfigInfo = albumconfiginfo;
     return acfm.SaveConfig();
 }