Example #1
0
        private bool BatchAddSpecial(SpecialInfo specialInfo, StringBuilder information)
        {
            bool flag = false;

            if (IsDir(specialInfo.SpecialDir))
            {
                information.Append("<li>" + specialInfo.SpecialName + "目录名只能是字母、数字、下划线组成,首字符不能是数字!</li>");
                return(flag);
            }
            if (Special.ExistsSpecialName(specialInfo.SpecialName))
            {
                information.Append("<li>" + specialInfo.SpecialName + "专题名已经存在,请输入其它的专题名!</li>");
                return(flag);
            }
            if (Special.ExistsSpecialDir(specialInfo.SpecialDir))
            {
                information.Append("<li>" + specialInfo.SpecialDir + "专题目录已经存在,请输入其它的目录名!</li>");
                return(flag);
            }
            if (Special.AddSpecial(specialInfo))
            {
                this.InputPermissions(specialInfo.SpecialId);
                this.InputRolePermission(specialInfo.SpecialId);
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                return(true);
            }
            information.Append("<li>" + specialInfo.SpecialName + "专题信息保存失败!</li>");
            return(flag);
        }
Example #2
0
 private void AddSpecial(SpecialInfo specialInfo)
 {
     if (Special.ExistsSpecialName(specialInfo.SpecialName))
     {
         AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "");
     }
     if (Special.ExistsSpecialDir(specialInfo.SpecialDir))
     {
         AdminPage.WriteErrMsg("<li>此专题目录已经存在,请输入其它的目录名!</li>", "");
     }
     if (Special.AddSpecial(specialInfo))
     {
         this.InputPermissions(specialInfo.SpecialId);
         this.InputRolePermission(specialInfo.SpecialId);
         IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
         base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
         AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "Special.aspx?SpecialCategoryID=" + this.specialCategoryId.ToString());
     }
     else
     {
         AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "");
     }
 }