예제 #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);
        }
예제 #2
0
 protected void EBtnModify_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         SpecialInfo specialInfo = this.GetSpecialInfo();
         specialInfo.SpecialId      = this.specialId;
         specialInfo.OrderId        = DataConverter.CLng(this.HdnOrderId.Value);
         specialInfo.NeedCreateHtml = true;
         string specialName = specialInfo.SpecialName;
         if ((specialName != this.HdnSpecialName.Value) && Special.ExistsSpecialName(specialName))
         {
             AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "Special.aspx");
         }
         if (Special.UpdateSpecial(specialInfo))
         {
             this.InputPermissions(specialInfo.SpecialId);
             this.InputRolePermission(specialInfo.SpecialId);
             IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
             AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "SpecialManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "SpecialManage.aspx");
         }
     }
 }
예제 #3
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>", "");
     }
 }