Example #1
0
    public string CreateChannel(string chId)
    {
        B_SiteInfo SiteBll = new B_SiteInfo();
        B_Channel ChannelBll = new B_Channel();
        M_Site SiteModel = SiteBll.GetSiteModel();
        if (!SiteModel.IsStaticType)
        {
            return "fail$全站参数设置没有开启生成静态页面功能";
        }
        string chIdStr = "";
        M_Channel channelModel = ChannelBll.GetChannel(int.Parse(chId));
        if (channelModel != null && channelModel.IsStaticType)
        {
            chIdStr = chIdStr + chId + ",";
        }

        if (chIdStr == string.Empty)
        {
            return "fail$所选频道没有开启生成静态页面功能";
        }
        chIdStr = chIdStr.Substring(0, (chIdStr.Length - 1));

        Session["createchid"] = chIdStr;
        return "succ$" + chIdStr;
    }
Example #2
0
 public void ClearCache(string str)
 {
     B_Create createBll = new B_Create();
     B_Channel channelBll = new B_Channel();
     B_Column columnBll = new B_Column();
     channelBll.ClearCache();
     columnBll.ClearCache();
     createBll.ClearHashTable();
     GC.Collect();
 }
Example #3
0
 public string CreateInfoByColId(string colId)
 {
     B_SiteInfo SiteBll = new B_SiteInfo();
     B_Channel ChannelBll = new B_Channel();
     M_Site SiteModel = SiteBll.GetSiteModel();
     if (!SiteModel.IsStaticType)
     {
         return "fail$全站参数设置没有开启生成静态页面功能";
     }
     B_Column columnBll = new B_Column();
     M_Column columnModel = columnBll.GetColumn(int.Parse(colId));
     M_Channel channelModel = ChannelBll.GetChannel(columnModel.ChId);
     if (channelModel == null || !channelModel.IsStaticType)
     {
         return "fail$所属频道没有开启生成静态页面功能";
     }
     Session["newscolumnid"] = colId;
     return "succ$" + channelModel.ModelType;
 }
Example #4
0
 public void bind()
 {
     B_Channel ch = new B_Channel();
     DataView dv = ch.GetList(false);
     if (ChType != -1)
     {
         DataTable dt = dv.ToTable();
         DataView dv2 = new DataView(dt);
         dv2.RowFilter = "[chtype]=" + ChType;
         repChannel.DataSource = dv2;
         spanAddChannel.Visible = false;
         litAddChannel.Visible = true;
         litAddChannel.Text = "<a href='SetChannel.aspx?ChType="+ChType+"'>添加频道</a>";
     }
     else
     {
         repChannel.DataSource = dv;
     }
     repChannel.DataBind();
 }
Example #5
0
 /// <summary>
 /// 绑定频道
 /// </summary>
 void BindChannel()
 {
     B_Channel channel = new B_Channel();
     ddlChannel.DataSource = channel.GetChannelByType(0);
     ddlChannel.DataTextField = "ChName";
     ddlChannel.DataValueField = "ChId";
     ddlChannel.DataBind();
     ddlChannel.Items.Insert(0, new ListItem("设为全站专题", "0"));
 }
Example #6
0
 protected void repChannel_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     B_Channel channelBll = new B_Channel();
     int idx = e.Item.ItemIndex;
     Label lbChId = (Label)repChannel.Items[idx].FindControl("ChId");
     Label Type = (Label)repChannel.Items[idx].FindControl("ModelType");
     int chId = int.Parse(lbChId.Text);
     if (e.CommandName == "state")
     {
         GroupBll.Power_Judge(36);
         LinkButton btn = (LinkButton)e.CommandSource;
         if (btn.Text == "禁用")
         {
             channelBll.SetDisable(chId, true);
         }
         else
         {
             channelBll.SetDisable(chId, false);
         }
         this.bind();
     }
     if (e.CommandName == "delete")
     {
         GroupBll.Power_Judge(36);
         channelBll.Delete(chId);
         Response.Write("<script>parent.document.frames['LeftIframe'].location.reload();location.href('ChannelList.aspx');</script>");
     }
 }
Example #7
0
 public void Auditing(string tableName, string idStr, int status)
 {
     if (idStr != string.Empty)
     {
         B_Admin admin = new B_Admin();
         B_Column column = new B_Column();
         B_Channel channel = new B_Channel();
         string[] strArray = idStr.Split(new char[] { ',' });
         foreach (string str in strArray)
         {
             int id = int.Parse(str);
             DataRow info = this.dal.GetInfo(tableName, id);
             if (info == null)
             {
                 break;
             }
             int columnId = (int) info["colid"];
             M_Column column2 = column.GetColumn(columnId);
             if (column2 == null)
             {
                 break;
             }
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 == null)
             {
                 break;
             }
             int num3 = (int) info["Status"];
             int num4 = (int) info["UserType"];
             int userId = (int) info["UId"];
             string str2 = info["UName"].ToString();
             string newValue = info["Title"].ToString();
             string str4 = channel2.Notice2.Replace("{@标题}", newValue);
             M_LoginAdmin loginModel = admin.GetLoginModel();
             int adiminId = loginModel.UserId;
             string loginName = loginModel.LoginName;
             this.dal.Auditing(tableName, id, status, adiminId, loginName);
             if ((((status == 3) && (num3 != 3)) && (num4 == 0)) && (userId > 0))
             {
                 B_WebMessage message = new B_WebMessage();
                 M_WebMessage message2 = new M_WebMessage();
                 message2.Title = "稿件采纳通知";
                 message2.Content = str4;
                 message2.IsRead = 0;
                 message2.IsSend = 1;
                 message2.ReceiverId = userId;
                 message2.ReceiverName = str2;
                 message2.SendId = 0;
                 message2.SendName = loginName;
                 message2.OverdueDate = DateTime.Now;
                 message2.AddDate = DateTime.Now;
                 message2.ReceiverDel = 0;
                 message2.SendDel = 0;
                 message.Insert(message2);
             }
             M_User user = new B_User().GetUser(userId);
             if (user == null)
             {
                 break;
             }
             B_UserGroup group = new B_UserGroup();
             M_UserGroup model = group.GetModel(user.GroupID);
             if (group == null)
             {
                 break;
             }
             int num7 = int.Parse(group.Power_UserGroup("Contribute", 0, model.GroupPower)) * column2.ScoreReward;
             new B_Money().Integral(num7, userId);
         }
     }
 }
Example #8
0
 public void Cancel(string tableName, int id)
 {
     B_Channel channel = new B_Channel();
     B_Column column = new B_Column();
     B_Admin admin = new B_Admin();
     DataRow info = this.dal.GetInfo(tableName, id);
     if (info != null)
     {
         int columnId = (int) info["colid"];
         M_Column column2 = column.GetColumn(columnId);
         if (column2 != null)
         {
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 != null)
             {
                 int num2 = (int) info["UserType"];
                 int num3 = (int) info["UId"];
                 string str = info["UName"].ToString();
                 string newValue = info["Title"].ToString();
                 string str3 = channel2.Notice1.Replace("{@标题}", newValue);
                 string loginName = admin.GetLoginModel().LoginName;
                 this.dal.Cancel(tableName, id);
                 if ((num2 == 0) && (num3 > 0))
                 {
                     B_WebMessage message = new B_WebMessage();
                     M_WebMessage model = new M_WebMessage();
                     model.Title = "退稿通知";
                     model.Content = str3;
                     model.IsRead = 0;
                     model.IsSend = 1;
                     model.ReceiverId = num3;
                     model.ReceiverName = str;
                     model.SendId = 0;
                     model.SendName = loginName;
                     model.OverdueDate = DateTime.Now;
                     model.AddDate = DateTime.Now;
                     model.ReceiverDel = 0;
                     model.SendDel = 0;
                     message.Insert(model);
                 }
             }
         }
     }
 }
Example #9
0
 private void ChannelBind()
 {
     B_Channel bll = new B_Channel();
     lbChannel.DataSource = bll.GetList(false);
     lbChannel.DataTextField = "ChName";
     lbChannel.DataValueField = "ChId";
     lbChannel.DataBind();
 }
Example #10
0
 public string GetInfoUrl(string chId,string colId)
 {
     B_Channel channelBll = new B_Channel();
     M_Channel channelModel = channelBll.GetChannel(int.Parse(chId));
     string pageUrl = "#";
     switch (channelModel.ModelType)
     {
         default:
             pageUrl = "info/AddInfo.aspx";
             break ;
         case 1:
             pageUrl = "info/SetArticle.aspx";
             break;
         case 2:
             pageUrl = "info/SetImage.aspx";
             break;
         case 3:
             pageUrl = "info/SetDownLoad.aspx";
             break;
     }
     if (colId == "0")
     {
         return pageUrl + "?ChId=" + chId;
     }
     else
     {
         return pageUrl + "?ChId=" + chId+"&ColId="+colId;
     }
 }
Example #11
0
    private void Bind()
    {
        int ChType = 1;
        B_Dictionary dictionBll = new B_Dictionary();
        DataTable chTypeDt = dictionBll.GetDictionary(ChType);

        for (int i = 0; i < chTypeDt.Rows.Count; i++)
        {
            TreeNode chTypeNode = new TreeNode();
            chTypeNode.ToolTip = "分类右键操作$" + chTypeDt.Rows[i]["id"].ToString();
            chTypeNode.Text = chTypeDt.Rows[i]["DicName"].ToString();
            chTypeNode.ImageUrl = "~/system/images/category.gif";
            chTypeNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=" + chTypeDt.Rows[i]["id"].ToString();
            chTypeNode.Target = "ContentIframe";
            tvNav.Nodes.Add(chTypeNode);
        }
        TreeNode chTypeOtherNode = new TreeNode();
        chTypeOtherNode.ToolTip = "分类右键操作$0";
        chTypeOtherNode.Text = "其他";
        chTypeOtherNode.ImageUrl = "~/system/images/category.gif";
        chTypeOtherNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=0";
        chTypeOtherNode.Target = "ContentIframe";
        tvNav.Nodes.Add(chTypeOtherNode);

        B_Channel channelBll = new B_Channel();
        B_Column columnBll = new B_Column();
        DataView channelDv = channelBll.GetList(false);

        for (int i = 0; i < tvNav.Nodes.Count-1; i++)
        {
            int chType = int.Parse(chTypeDt.Rows[i]["id"].ToString());

            DataTable chDt = channelDv.ToTable();

            DataView chTypeDv = new DataView(chDt);
            chTypeDv.RowFilter=string.Format("[chtype]={0}",chType);
            for (int j = 0; j < chTypeDv.Count; j++)
            {
                TreeNode channelNode = new TreeNode();
                channelNode.ToolTip = "频道右键操作$" + chTypeDv[j]["ChId"].ToString() + "$" + chTypeDv[j]["ChType"].ToString();
                channelNode.Text = chTypeDv[j]["ChName"].ToString();
                channelNode.ImageUrl = "~/system/images/folder.gif";
                channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv[j]["ChId"];
                channelNode.Target = "ContentIframe";
                tvNav.Nodes[i].ChildNodes.Add(channelNode);
            }

            for (int j = 0; j < chTypeDv.Count; j++)
            {
                DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv[j]["ChId"]);
                DataTable dt = dv.ToTable();
                dv.Dispose();
                BindColumn(0, tvNav.Nodes[i].ChildNodes[j], dt, (int)chTypeDv[j]["ModelType"], (int)chTypeDv[j]["ChId"]);
            }
            chDt.Dispose();
            chTypeDv.Dispose();
        }
        DataTable chDt2 = channelDv.ToTable();
        DataView chTypeDv2 = new DataView(chDt2);
        chTypeDv2.RowFilter = "[chtype]=0 or [chtype] is null";
        for (int j = 0; j < chTypeDv2.Count; j++)
        {
            TreeNode channelNode = new TreeNode();
            channelNode.ToolTip = "频道右键操作$" + chTypeDv2[j]["ChId"].ToString() + "$" + chTypeDv2[j]["ChType"].ToString();
            channelNode.Text = chTypeDv2[j]["ChName"].ToString();
            channelNode.ImageUrl = "~/system/images/folder.gif";
            channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv2[j]["ChId"];
            channelNode.Target = "ContentIframe";
            tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes.Add(channelNode);
        }
        for (int j = 0; j < chTypeDv2.Count; j++)
        {
            DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv2[j]["ChId"]);
            DataTable dt = dv.ToTable();
            dv.Dispose();
            BindColumn(0, tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes[j], dt, (int)chTypeDv2[j]["ModelType"], (int)chTypeDv2[j]["ChId"]);
        }
        chDt2.Dispose();
        chTypeDv2.Dispose();
    }
Example #12
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string modelName = txtModelName.Text.Trim();
        if(modelName==string.Empty)
        {
            Function.ShowSysMsg(0, "<li>模型名称必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string tableName = txtTableName.Text.Trim();
        if(tableName==string.Empty)
        {
            Function.ShowSysMsg(0, "<li>表名称必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string patt = "^[a-zA-Z0-9]+$";
        if(!Regex.IsMatch(tableName,patt,RegexOptions.IgnoreCase))
        {
            Function.ShowSysMsg(0, "<li>表名称必须由字母或数字组成</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string uploadPath = txtUploadPath.Text.Trim();
        if(uploadPath==string.Empty)
        {
             Function.ShowSysMsg(0, "<li>上传文件存放目录必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        patt = "[a-zA-Z][a-zA-Z0-9]*$";
        if(!Regex.IsMatch(uploadPath,patt,RegexOptions.IgnoreCase))
        {
            Function.ShowSysMsg(0, "<li>存放目录必须以字母开头,由字母或数字组成</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string uploadSize = txtUploadSize.Text.Trim();
        if(!Function.CheckNumber(uploadSize))
        {
            Function.ShowSysMsg(0, "<li>允许上传的文件大小必须为0或正整数</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }

        M_InfoModel infoModel = new M_InfoModel();
        infoModel.ModelId = ModelId;
        infoModel.ModelName = txtModelName.Text.Trim();
        infoModel.ModelDesc = txtModelDesc.Text.Trim();
        infoModel.TableName = litU.Text + txtTableName.Text.Trim();
        infoModel.UploadPath = txtUploadPath.Text.Trim();
        infoModel.UploadSize = int.Parse(txtUploadSize.Text.Trim());
        infoModel.ModelHtml = "";
        infoModel.IsHtml = bool.Parse(IsHtml.SelectedValue);
        if (infoModel.ModelId == 0)
        {
            bool isValidate = InfoModelBll.CheckTableValidate(infoModel.TableName);
            if (!isValidate)
            {
                Function.ShowSysMsg(0, "<li>所设置的表名已经存在</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
            }

            //isValidate = InfoModelBll.CheckUploadPathValidate(infoModel.UploadPath);
            //if (!isValidate)
            //{
            //    Function.ShowSysMsg(0, "<li>所设置文件存放目录已经存在</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
            //}
            InfoModelBll.Add(infoModel);
        }
        else
        {
            InfoModelBll.Update(infoModel);
            B_Channel channelBll = new B_Channel();
            channelBll.ClearCache();
        }
        Function.ShowSysMsg(1, "<li>模型设置成功</li><li><a href='infomodel/ModelList.aspx'>返回模型管理列表</a></li>");
    }
Example #13
0
 public DataView GetChildCoumnByColId(int columnId)
 {
     DataTable table = new DataTable();
     table.Columns.Add("ColId", typeof(int));
     table.Columns.Add("ColName", typeof(string));
     table.Columns.Add("ModelType", typeof(int));
     table.Columns.Add("Type", typeof(int));
     table.Columns.Add("ChannelLinkId", typeof(int));
     table.Columns.Add("ColumnLinkId", typeof(int));
     DataView view = new DataView(this.GetAll());
     view.Sort = "Sort Asc";
     view.RowFilter = "ColParentId=" + columnId + " And IsDeleted=0";
     for (int i = 0; i < view.Count; i++)
     {
         DataRow row = table.NewRow();
         row["ColId"] = view[i]["ColId"];
         row["ColName"] = view[i]["ColName"];
         int id = Convert.ToInt32(view[i]["ChId"]);
         M_Channel channel = new B_Channel().GetChannel(id);
         row["ModelType"] = channel.ModelType;
         row["Type"] = 3;
         row["ChannelLinkId"] = view[i]["ChId"];
         row["ColumnLinkId"] = view[i]["ColId"];
         table.Rows.Add(row);
     }
     DataView view2 = new DataView(table);
     table.Dispose();
     return view2;
 }
Example #14
0
 public void ShowInfo()
 {
     B_Channel channelBll = new B_Channel();
     M_Channel model = channelBll.GetChannel(ChId);
     if (model == null)
     {
         Response.Write("<script type='text/javascript'>alert('所选频道不存在或已经被删除');history.back();</script>");
         Response.End();
         return;
     }
     txtChName.Text = model.ChName;
     try
     {
         ddlModelType.SelectedValue = model.ModelType.ToString();
     }
     catch { }
     ddlModelType.Enabled = false;
     txtDirName.Text = model.DirName;
     txtDirName.Enabled = false;
     txtTypeName.Text = model.TypeName;
     txtTypeUnit.Text = model.TypeUnit;
     if (model.IsChildSite)
     {
         rdIsChildSite2.Checked = true;
     }
     else
     {
         rdIsChildSite1.Checked = true;
     }
     txtChildSiteUrl.Text = model.ChildSiteUrl;
     txtDescription.Text = model.Description;
     txtTemplatePath.Text = model.TemplatePath;
     txtColumnTemplatePath.Text = model.ColumnTemplatePath;
     txtInfoTemplatePath.Text = model.InfoTemplatePath;
     txtCommentTemplatePath.Text = model.CommentTemplatePath;
     txtKeyword.Text = model.Keyword;
     txtContent.Text = model.Content;
     rblIsDisabled.SelectedValue = model.IsDisabled.ToString();
     rblIsOpenLink.SelectedValue = model.IsOpenLink.ToString();
     txtMiniHitCount.Text = model.MiniHitCount.ToString();
     rblIsOpened.SelectedValue = model.IsOpened.ToString();
     foreach (ListItem li in cblGroupIdStr.Items)
     {
         int groupId = int.Parse(li.Value);
         M_UserGroup userGroupModel = GroupBll.GetModel(groupId);
         string power = userGroupModel.ColumnPower;
         if (GroupBll.Power_ColumnPower(ChId, 0, power, 2))
         {
             li.Selected = true;
         }
     }
     ddlVerifyType.SelectedValue = model.VerifyType.ToString();
     txtNotice1.Text = model.Notice1;
     txtNotice2.Text = model.Notice2;
     rblIsStaticType.SelectedValue = model.IsStaticType.ToString();
     ddlColumnSortType.SelectedValue = model.ColumnSortType.ToString();
     ddlInfoSortType.SelectedValue = model.InfoSortType.ToString();
     ddlFileNameType.SelectedValue = model.FileNameType.ToString();
     rblChannelPageType.SelectedValue = model.ChannelPageType.ToString();
     rblColumnPageType.SelectedValue = model.ColumnPageType.ToString();
     rblInfoPageType.SelectedValue = model.InfoPageType.ToString();
     txtSort.Text = model.Sort.ToString();
 }
Example #15
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        B_Channel channelBll = new B_Channel();
        M_Channel model = new M_Channel();
        if (txtChName.Text.Trim().Length == 0)
        {
            litMsg.Text = "<script>alert('频道名称必须填写')</script>";
            return;
        }
        model.ChId = ChId;
        model.ChName = txtChName.Text.Trim();
        model.ChType = ChType;
        model.ModelType = int.Parse(ddlModelType.SelectedValue);

        string dirName = txtDirName.Text.Trim();
        if (!Regex.IsMatch(dirName, @"^[a-zA-Z][0-9a-zA-Z]*$"))
        {
            litMsg.Text = "<script>alert('频道(目录)英文名必须以字母开头,必须是字母和数字组成')</script>";
            return;
        }
        model.DirName = dirName;
        if (ChId == 0)
        {
            B_KyCommon commonBll = new B_KyCommon();
            bool flag = commonBll.CheckHas(model.DirName, "DirName", "KyChannel");
            if (flag)
            {
                litMsg.Text = "<script>alert('频道英文名已经存在')</script>";
                return;
            }
        }
        if (txtTypeName.Text.Trim().Length == 0)
        {
            litMsg.Text = "<script>alert('项目名称必须填写')</script>";
            return;
        }
        model.TypeName = txtTypeName.Text.Trim();
        if (txtTypeUnit.Text.Trim().Length == 0)
        {
            litMsg.Text = "<script>alert('项目单位必须填写')</script>";
            return;
        }
        model.TypeUnit = txtTypeUnit.Text.Trim();
        if (rdIsChildSite2.Checked)
        {
            model.IsChildSite = true;
        }
        else
        {
            model.IsChildSite = false;
        }
        if (model.IsChildSite && txtChildSiteUrl.Text.Trim().Length == 0)
        {
            litMsg.Text = "<script>alert('设置该频道为分站,分站地址必须填写')</script>";
            return;
        }
        model.ChildSiteUrl = model.IsChildSite ? txtChildSiteUrl.Text.Trim() : "";
        if (txtDescription.Text.Trim().Length > 255)
        {
            litMsg.Text = "<script>alert('网站描述不能超过255个字')</script>";
            return;
        }
        model.Description = txtDescription.Text.Trim();

        if (string.IsNullOrEmpty(Request.Form["txtTemplatePath"].Trim()))
        {
            litMsg.Text = "<script>alert('频道模板必须选择')</script>";
            return;
        }
        model.TemplatePath = Request.Form["txtTemplatePath"].Trim();
        if (string.IsNullOrEmpty(Request.Form["txtColumnTemplatePath"].Trim()))
        {
            litMsg.Text = "<script>alert('栏目页模板必须选择')</script>";
            return;
        }
        model.ColumnTemplatePath = Request.Form["txtColumnTemplatePath"].Trim();
        if (string.IsNullOrEmpty(Request.Form["txtInfoTemplatePath"].Trim()))
        {
            litMsg.Text = "<script>alert('内容页模板必须选择')</script>";
            return;
        }
        model.InfoTemplatePath = Request.Form["txtInfoTemplatePath"].Trim();
        if (string.IsNullOrEmpty(Request.Form["txtCommentTemplatePath"].Trim()))
        {
            litMsg.Text = "<script>alert('评论页模板必须选择')</script>";
            return;
        }
        model.CommentTemplatePath = Request.Form["txtCommentTemplatePath"].Trim();
        model.Keyword = txtKeyword.Text.Trim();
        if (txtContent.Text.Trim().Length > 300)
        {
            litMsg.Text = "<script>alert('META网页描述不能超过300个字')</script>";
            return;
        }
        model.Content = txtContent.Text.Trim();
        model.IsDisabled = bool.Parse(rblIsDisabled.SelectedValue);
        model.IsOpenLink = bool.Parse(rblIsOpenLink.SelectedValue);
        string miniHitCount = txtMiniHitCount.Text.Trim();
        if (!Function.CheckNumber(miniHitCount))
        {
            litMsg.Text = "<script>alert('热点点击数最小值必须是0或正整数')</script>";
            return;
        }
        model.MiniHitCount = int.Parse(miniHitCount);
        model.IsOpened = bool.Parse(rblIsOpened.SelectedValue);
        model.GroupIdStr = "";
        string columnPower = string.Empty;
        string power = string.Empty;

        model.VerifyType = int.Parse(ddlVerifyType.SelectedValue);
        if (txtNotice1.Text.Trim().Length > 500)
        {
            litMsg.Text = "<script>alert('退稿时通知信息内容不能超过500个字')</script>";
            return;
        }
        model.Notice1 = txtNotice1.Text.Trim();
        if (txtNotice2.Text.Trim().Length > 500)
        {
            litMsg.Text = "<script>alert('采纳时通知信息内容不能超过500个字')</script>";
            return;
        }
        model.Notice2 = txtNotice2.Text.Trim();
        model.IsStaticType = bool.Parse(rblIsStaticType.SelectedValue);
        model.ColumnSortType = int.Parse(ddlColumnSortType.SelectedValue);
        model.InfoSortType = int.Parse(ddlInfoSortType.SelectedValue);
        model.FileNameType = int.Parse(ddlFileNameType.SelectedValue);
        model.ChannelPageType = int.Parse(rblChannelPageType.SelectedValue);
        model.ColumnPageType = int.Parse(rblColumnPageType.SelectedValue);
        model.InfoPageType = int.Parse(rblInfoPageType.SelectedValue);

        model.IsDeleted = false;
        string sort = txtSort.Text.Trim();
        if (!Function.CheckNumber(sort))
        {
            litMsg.Text = "<script>alert('频道排序编号必须是0或正整数')</script>";
            return;
        }
        model.Sort = int.Parse(sort);
        model.AddTime = DateTime.Now;
        int currChId = 0;
        if (ChId == 0)
        {
            currChId = channelBll.Add(model);
        }
        else
        {
            currChId = channelBll.Update(model);
        }
        foreach (ListItem li in cblGroupIdStr.Items)
        {
            int groupId = int.Parse(li.Value);
            M_UserGroup userGroupModel = GroupBll.GetModel(groupId);
            power = userGroupModel.ColumnPower;
            int a = GroupBll.Power_ColumnPower(currChId, 0, power, 1) ? 1 : 0;
            int c = GroupBll.Power_ColumnPower(currChId, 0, power, 3) ? 1 : 0;
            if (li.Selected)
                power = GroupBll.ColumnPower_ColumnPower(currChId, 0, power, a, 1, c);
            else
                power = GroupBll.ColumnPower_ColumnPower(currChId, 0, power, a, 0, c);
            userGroupModel.ColumnPower = power;
            GroupBll.Update(userGroupModel);
        }
        Response.Write("<script>parent.document.frames['LeftIframe'].location.reload();location.href('ChannelList.aspx');</script>");
    }