Example #1
0
    /// <summary>
    /// 递归栏目信息
    /// </summary>
    /// <param name="n"></param>
    public void ListControl_Bind(int n)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dt          = bllcolumn.GetList("parentId=" + n + "order by orderNumber desc");

        dt.Tables[0].Columns.Add("Operate", typeof(string)); //操作
        dt.Tables[0].Columns.Add("Colum", typeof(String));   //在dt中增加字段名为Colum的列
        if (dt.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
            {
                DataRow dr      = dt.Tables[0].Rows[i];
                string  strchar = "";
                dr["operate"] = "<a href='Column_edit.aspx?action=add&classid=" + dr["classid"].ToString() + "&parentId=" + dr["parentId"].ToString() + "'>[添加下级]</a>&nbsp;&nbsp;<a href='Column_edit.aspx?action=edit&classid=" + dr["classid"].ToString() + "&parentId=" + dr["parentId"].ToString() + "'>[编辑]</a>&nbsp;&nbsp;<a href='Column_list.aspx??action=del&classID=" + dr["classid"].ToString() + "&classname=" + dr["className"].ToString() + " ' onclick='return confirm(\"真的要删除该栏目以及子栏目和栏目下的新闻吗?不可恢复!\");'>[删除]</a> ";
                strchar      += "<tr  onmouseover=this.bgColor='#EBFFDC'; onmouseout=this.bgColor='#ffffff';  bgcolor='#ffffff'>";
                strchar      += "<td align=\"center\"><input type='checkbox'/></td> ";
                strchar      += "<td align=\"left\">" + dr["classid"].ToString() + "</td> ";
                strchar      += "<td align=\"left\" >" + dr["className"].ToString() + "</td>";
                strchar      += "<td align=\"center\" >" + GetClassisShowChannel(dr["isShowChannel"].ToString()) + "</td>";
                strchar      += "<td align=\"center\" >" + GetClassAttrbute(dr["modelId"].ToString()) + "</td>";
                strchar      += "<td align=\"left\" >" + dr["orderNumber"].ToString() + "</td>";
                strchar      += "<td align=\"center\" >" + dr["operate"].ToString() + "</td>";
                strchar      += "</tr>";
                strchar       = InitChild(dr, strchar, 2);
                dr["Colum"]   = strchar;
            }
        }
        this.rptList.DataSource = dt;
        this.rptList.DataBind();
    }
Example #2
0
    /// <summary>
    /// 递归栏目信息
    /// </summary>
    /// <param name="n"></param>
    public void ListControl_Bind(int n)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dt          = bllcolumn.GetList("parentId=" + n + "");

        dt.Tables[0].Columns.Add("Operate", typeof(string)); //操作
        dt.Tables[0].Columns.Add("Colum", typeof(String));   //在dt中增加字段名为Colum的列
        if (dt.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
            {
                DataRow dr      = dt.Tables[0].Rows[i];
                string  strchar = "";
                strchar    += "<td style='white-space:nowrap;word-break:break-all;overflow:hidden;' >";
                strchar    += "<input id='rptList_ctl00_hidName' type='hidden' name='rptList$ctl00$hidName' Value='" + dr["className"].ToString() + "' runat='server' />";
                strchar    += "<input id=='rptList_ctl00_hidActionType' type='hidden' name='rptList$ctl00$hidActionType' Value='" + dr["action_type"].ToString() + "' runat='server' />";
                strchar    += "<input id='rptList_ctl00_hidLayer' type='hidden' name='rptList$ctl00$hidLayer' Value='" + dr["class_layer"].ToString() + "' runat='server' />";
                strchar    += "<span class='folder-open'></span>";
                strchar    += dr["className"].ToString();
                strchar    += "</td>";
                strchar     = InitChild(dr, strchar, 2);
                dr["Colum"] = strchar;
            }
        }
        this.rptList.DataSource = dt;
        this.rptList.DataBind();
    }
Example #3
0
    private string InitChild(DataRow dr, string strchar, int n)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dtt         = bllcolumn.GetList("parentId=" + dr["classid"] + "order by orderNumber desc");

        dtt.Tables[0].Columns.Add("Operate", typeof(string));
        dtt.Tables[0].Columns.Add("Colum", typeof(String));
        if (dtt.Tables[0].Rows.Count > 0)
        {
            string s = "&nbsp;";
            for (int j = 1; j <= n; j++)
            {
                s += "&nbsp;";
            }
            for (int k = 0; k < dtt.Tables[0].Rows.Count; k++)
            {
                DataRow dro  = dtt.Tables[0].Rows[k];
                string  flag = "├";
                if (dtt.Tables[0].Rows.Count == 1)
                {
                    flag = "├";
                }
                else
                {
                    if (k == 0)
                    {
                        flag = "├";
                    }
                    if (k == dtt.Tables[0].Rows.Count - 1)
                    {
                        flag = "├";
                    }
                }
                dro["operate"] = "<a href='Column_edit.aspx?action=add&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString() + "'>[添加下级]</a>&nbsp;&nbsp;<a href='Column_edit.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString() + "'>[编辑]</a>&nbsp;&nbsp;<a href='Column_list.aspx?action=del&classid=" + dro["classid"].ToString() + "&classname=" + dro["className"].ToString() + " ' onclick='return confirm(\"真的要删除?栏目删除之后,该栏目下的新闻也将删除,不可恢复!\");'>[删除]</a>";
                strchar       += "<tr  onmouseover=this.bgColor='#EBFFDC'; onmouseout=this.bgColor='#ffffff';  bgcolor='#ffffff'>";
                strchar       += "<td align=\"center\"><input type='checkbox'/></td> ";
                strchar       += "<td align=\"left\">" + dro["classid"].ToString() + "</td> ";
                strchar       += "<td align=\"left\" >" + s + flag + dro["className"].ToString() + "</td>";
                strchar       += "<td align=\"center\" >" + GetClassisShowChannel(dro["isShowChannel"].ToString()) + "</td>";
                strchar       += "<td align=\"center\" >" + GetClassAttrbute(dro["modelId"].ToString()) + "</td>";
                strchar       += "<td align=\"left\" >" + dro["orderNumber"].ToString() + "</td>";
                strchar       += "<td align=\"center\" >" + dro["Operate"].ToString() + "</td>";
                strchar       += "</tr>";
                strchar        = InitChild(dro, strchar, n + 8);
            }
        }
        return(strchar);
    }
Example #4
0
    private string InitChild(DataRow dr, string strchar, int n)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dtt         = bllcolumn.GetList("parentId=" + dr["classid"] + "");

        dtt.Tables[0].Columns.Add("Operate", typeof(string));
        dtt.Tables[0].Columns.Add("Colum", typeof(String));
        if (dtt.Tables[0].Rows.Count > 0)
        {
            string s = "&nbsp;";
            for (int j = 1; j <= n; j++)
            {
                s += "&nbsp;";
            }
            for (int k = 0; k < dtt.Tables[0].Rows.Count; k++)
            {
                DataRow dro  = dtt.Tables[0].Rows[k];
                string  flag = "├";
                if (dtt.Tables[0].Rows.Count == 1)
                {
                    flag = "├";
                }
                else
                {
                    if (k == 0)
                    {
                        flag = "├";
                    }
                    if (k == dtt.Tables[0].Rows.Count - 1)
                    {
                        flag = "├";
                    }
                }
                strchar += "<td style='white-space:nowrap;word-break:break-all;overflow:hidden;' >";
                strchar += "<input id='rptList_ctl00_hidName' type='hidden' name='rptList$ctl00$hidName' Value='" + dro["className"].ToString() + "' runat='server' />";
                strchar += "<input id=='rptList_ctl00_hidActionType' type='hidden' name='rptList$ctl00$hidActionType' Value='" + dro["action_type"].ToString() + "' runat='server' />";
                strchar += "<input id='rptList_ctl00_hidLayer' type='hidden' name='rptList$ctl00$hidLayer' Value='" + dro["class_layer"].ToString() + "' runat='server' />";
                strchar += "<span class='folder-open'></span>";
                strchar += dro["className"].ToString();
                strchar += "</td>";
                strchar  = InitChild(dro, strchar, n + 8);
            }
        }
        return(strchar);
    }
Example #5
0
    private void ChileNodeBind(DataRow drr, DropDownList parentId, int m)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dss         = bllcolumn.GetList("parentId=" + drr["classId"] + "");

        if (dss.Tables[0].Rows.Count > 0)
        {
            string s = System.Web.HttpContext.Current.Server.HtmlDecode("&nbsp;");
            for (int j = 1; j <= m; j++)
            {
                s += System.Web.HttpContext.Current.Server.HtmlDecode("&nbsp;");
            }
            for (int k = 0; k < dss.Tables[0].Rows.Count; k++)
            {
                DataRow dro  = dss.Tables[0].Rows[k];
                string  flag = "├";
                if (dss.Tables[0].Rows.Count == 1)
                {
                    flag = "├";
                }
                else
                {
                    if (k == 0)
                    {
                        flag = "├";
                    }
                    if (k == dss.Tables[0].Rows.Count - 1)
                    {
                        flag = "├";
                    }
                }
                ListItem item = new ListItem();
                item.Text  = s + flag + dro["className"].ToString();
                item.Value = dro["classId"].ToString();

                parentId.Items.Add(item);

                ChileNodeBind(dro, parentId, m + 5);
            }
        }
    }
Example #6
0
    public void DropList_Bind()
    {
        cblItem.Items.Clear();
        //parentId.Items.Add(new ListItem("作为一级分类", "0"));
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            ds          = bllcolumn.GetList("parentId=26");

        if (ds.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow  dr   = ds.Tables[0].Rows[i];
                ListItem item = new ListItem();
                item.Text  = "" + dr["className"].ToString();
                item.Value = dr["classId"].ToString();
                cblItem.Items.Add(item);
                ChileNodeBind(dr, cblItem, 2);
            }
        }
    }
Example #7
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        Cms.BLL.C_Column bll = new Cms.BLL.C_Column();
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                Cms.Model.C_Column model = bll.GetModel(id);
                if (model != null)
                {
                    int count = Cms.DBUtility.DbHelperSQL.ExecuteSql("delete from C_article where parentId=" + id); //删除文章
                    adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.className);                   //记录日志
                    bll.Delete(id);
                }
            }
        }

        JscriptMsg("删除数据成功!", "Column_list.aspx", "Success");
    }
Example #8
0
 public void Del()
 {
     if (Request.QueryString["action"] != null)
     {
         if (Request.QueryString["action"].ToString() == "del")
         {
             int                classid      = Convert.ToInt32(Request.QueryString["classid"].ToString());
             string             strclassname = Request.QueryString["classname"].ToString();
             Cms.BLL.C_Column   bllcolumn    = new Cms.BLL.C_Column();
             Cms.Model.C_Column model        = bllcolumn.GetModel(classid);
             adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.className); //记录日志
             if (model != null && bllcolumn.Delete(classid))
             {
                 JscriptMsg("删除栏目信息成功!", "Column_list.aspx", "Success");
             }
             else
             {
                 JscriptMsg("删除栏目信息失败!", "Column_list.aspx", "Error");
             }
         }
     }
 }
Example #9
0
    public void DropList_Bind()
    {
        ddlRoleId.Items.Clear();

        Cms.BLL.C_admin_role blladmin_role = new Cms.BLL.C_admin_role();
        Cms.Model.C_Column   modelcolumn   = new Cms.Model.C_Column();
        DataSet ds = blladmin_role.GetList("");

        if (ds.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow dr = ds.Tables[0].Rows[i];
                if (Convert.ToInt32(dr["role_type"]) >= Convert.ToInt32(Application["adminType"]))
                {
                    ListItem item = new ListItem();
                    item.Text  = "" + dr["role_name"].ToString();
                    item.Value = dr["id"].ToString();
                    ddlRoleId.Items.Add(item);
                }
            }
        }
    }
Example #10
0
    public void DataBind(int classId)
    {
        Cms.BLL.C_Column   bllcolumn = new Cms.BLL.C_Column();
        Cms.Model.C_Column model     = bllcolumn.GetModel(classId);
        DataSet            ds        = bllcolumn.GetList("classId=" + classId + "");

        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];
            this.parentId.SelectedValue = model.parentId.ToString();    //上级栏目ID
            this.modelId.SelectedValue  = model.modelId.ToString();     //栏目模型ID
            this.className.Text         = model.className.ToString();   //栏目名称
            this.sub_title.Text         = model.sub_title.ToString();   //副名称
            this.engName.Text           = model.engName.ToString();     //栏目英文名称
            this.orderNumber.Text       = model.orderNumber.ToString(); //栏目排序
            this.photoUrl.Value         = model.photoUrl.ToString();    //栏目缩略图
            this.photoUrlone.Value      = model.photoUrlone.ToString(); //栏目图标True
            this.photoUrltwo.Value      = model.photoUrltwo.ToString(); //栏目图标False


            string ShowChannel = model.isShowChannel.ToString();
            if (ShowChannel == "0")
            {
                isShowChannel.Checked = false;//是否参与导航 0是参与导航
            }
            else
            {
                isShowChannel.Checked = true;//是否参与导航 1是不参与导航
            }
            string ShowNext = model.isShowNext.ToString();
            if (ShowNext == "0")
            {
                isShowNext.Checked = false;//是否显示子栏目 0是显示
            }
            else
            {
                isShowNext.Checked       = true;//是否显示子栏目 1是隐藏
                best_tab_item.Visible    = true;
                best_tab_content.Visible = true;
            }
            string Blank = model.isBlank.ToString();
            if (Blank == "0")
            {
                isBlank.Checked = false;//是否打开新窗口 0是不打开新窗口
            }
            else
            {
                isBlank.Checked = true;//是否打开新窗口 1是打开新窗口
            }
            string Hidden = model.isHidden.ToString();
            if (Hidden == "0")
            {
                isHidden.Checked = false;//是否隐藏 0是显示
            }
            else
            {
                isHidden.Checked = true;                       //是否隐藏 1是隐藏
            }
            this.linkUrl.Text      = model.linkUrl.ToString(); //外链地址
            this.tplChannel.Text   = model.tplChannel.ToString();
            this.tplContent.Text   = model.tplContent.ToString();
            this.listinfopath.Text = model.listinfopath.ToString();     //后台列表信息地址
            this.txtCallIndex.Text = model.name.ToString();             //调用别名
            this.columnchose.Text  = model.related.ToString();          //关联栏目

            this.intro.Text          = model.intro.ToString();          //栏目简介
            this.content.Value       = model.content.ToString();        //栏目内容
            this.seoTitle.Text       = model.seoTitle.ToString();       //SEO标题
            this.seoKeyword.Text     = model.seoKeyword.ToString();     //SEO关键字
            this.seoDescription.Text = model.seoDescription.ToString(); //SEO描述

            string wisShowChannel = model.w_isShowChannel.ToString();   //是否参与手机导航 0是参与导航
            if (wisShowChannel == "0")
            {
                w_isShowChannel.Checked = false;//是否参与手机导航 1是不参与导航
            }
            else
            {
                w_isShowChannel.Checked = true;//是否参与导航 1是不参与导航
                wap_tab_item.Visible    = true;
                wap_tab_content.Visible = true;
            }
            this.w_linkUrl.Text = model.w_linkUrl.ToString();         //手机链接地址

            this.w_intro.Text    = model.w_intro.ToString();          //手机站简介
            this.w_content.Value = model.w_content.ToString();        //手机站内容

            string eisShowChannel = model.e_isShowChannel.ToString(); //是否参与英文导航 0是参与导航
            if (eisShowChannel == "0")
            {
                e_isShowChannel.Checked = false;//是否参与英文导航 1是不参与导航
            }
            else
            {
                e_isShowChannel.Checked     = true;//是否参与英文导航 1是不参与导航
                english_tab_item.Visible    = true;
                english_tab_content.Visible = true;
            }
            this.e_linkUrl.Text = model.e_linkUrl.ToString();               //手英文链接地址

            this.e_intro.Text          = model.e_intro.ToString();          //英文站简介
            this.e_content.Value       = model.e_content.ToString();        //英文站内容
            this.e_seoTitle.Text       = model.e_seoTitle.ToString();       //英文站SEO标题
            this.e_seoKeyword.Text     = model.e_seoKeyword.ToString();     //英文站SEO关键字
            this.e_seoDescription.Text = model.e_seoDescription.ToString(); //英文站SEO描述



            if (model.is_albums == 1)
            {
                cbIsAlbums.Checked = true;
            }
            if (model.is_attach == 1)
            {
                cbIsAttach.Checked = true;
            }
            txtPageSize.Text = model.page_size.ToString();

            #region 赋值操作权限类型=============================
            string[] actionTypeArr = model.action_type.Split(',');
            for (int i = 0; i < cblActionType.Items.Count; i++)
            {
                for (int n = 0; n < actionTypeArr.Length; n++)
                {
                    if (actionTypeArr[n].ToLower() == cblActionType.Items[i].Value.ToLower())
                    {
                        cblActionType.Items[i].Selected = true;
                    }
                }
            }
            #endregion

            #region 赋值扩展字段=============================
            if (model.channel_fields != null)
            {
                for (int i = 0; i < cblAttributeField.Items.Count; i++)
                {
                    Cms.Model.C_Column_field modelt = model.channel_fields.Find(p => p.field_id == int.Parse(cblAttributeField.Items[i].Value)); //查找对应的字段ID
                    if (modelt != null)
                    {
                        cblAttributeField.Items[i].Selected = true;
                    }
                }
            }
            #endregion
        }
    }
Example #11
0
    public void DataUpdate(int classid)
    {
        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        modelcolumn.classId  = classid;                                      //栏目ID
        modelcolumn.parentId = Convert.ToInt32(this.parentId.SelectedValue); //上级栏目ID
        string class_layer = getclasslayer(Convert.ToInt32(this.parentId.SelectedValue), 1);

        modelcolumn.class_layer = Convert.ToInt32(class_layer);
        modelcolumn.modelId     = Convert.ToInt32(this.modelId.SelectedValue);   //栏目模型ID
        modelcolumn.className   = this.className.Text.Trim();                    //栏目名称
        modelcolumn.sub_title   = this.sub_title.Text.Trim();                    //副名称
        modelcolumn.engName     = this.engName.Text.Trim();                      //栏目英文名称
        modelcolumn.orderNumber = Convert.ToInt32(this.orderNumber.Text.Trim()); //栏目排序
        modelcolumn.photoUrl    = this.photoUrl.Value.Trim();                    //栏目缩略图
        modelcolumn.photoUrlone = this.photoUrlone.Value;                        //栏目图标True
        modelcolumn.photoUrltwo = this.photoUrltwo.Value;                        //栏目图标False

        modelcolumn.nav_type = Cms.Common.Enums.NavigationEnum.WebSite.ToString();

        modelcolumn.isShowChannel = 0;//是否参与导航 0是参与导航
        if (isShowChannel.Checked == true)
        {
            modelcolumn.isShowChannel = 1; //是否参与导航 1是不参与导航
        }
        modelcolumn.isShowNext = 0;        //是否显示子栏目 0是显示
        if (isShowNext.Checked == true)
        {
            modelcolumn.isShowNext = 1; //是否显示子栏目 1是隐藏
        }
        modelcolumn.isBlank = 0;        //是否打开新窗口 0是不打开新窗口
        if (isBlank.Checked == true)
        {
            modelcolumn.isBlank = 1; //是否打开新窗口 1是打开新窗口
        }
        modelcolumn.isHidden = 0;    //是否隐藏 0是显示
        if (isHidden.Checked == true)
        {
            modelcolumn.isHidden = 1;//是否打开新窗口 1是隐藏
        }

        //添加操作权限类型
        string action_type_str = string.Empty;

        for (int i = 0; i < cblActionType.Items.Count; i++)
        {
            if (cblActionType.Items[i].Selected && Utils.ActionType().ContainsKey(cblActionType.Items[i].Value))
            {
                action_type_str += cblActionType.Items[i].Value + ",";
            }
        }
        if (action_type_str == "")
        {
            modelcolumn.action_type = action_type_str;
        }
        else
        {
            modelcolumn.action_type = Utils.DelLastComma(action_type_str);
        }

        //end

        modelcolumn.linkUrl      = this.linkUrl.Text.Trim();//列表调用地址
        modelcolumn.tplChannel   = this.tplChannel.Text.Trim();
        modelcolumn.tplContent   = this.tplContent.Text.Trim();
        modelcolumn.listinfopath = this.listinfopath.Text.Trim();     //后台列表信息地址
        modelcolumn.name         = txtCallIndex.Text;                 //调用别名
        modelcolumn.related      = columnchose.Text;                  //关联栏目

        modelcolumn.seoTitle       = this.seoTitle.Text.Trim();       //SEO标题
        modelcolumn.seoKeyword     = this.seoKeyword.Text.Trim();     //SEO关键字
        modelcolumn.seoDescription = this.seoDescription.Text.Trim(); //SEO描述
        modelcolumn.intro          = this.intro.Text;                 //栏目简介
        modelcolumn.content        = this.content.Value;              //栏目内容

        modelcolumn.w_isShowChannel = 0;                              //是否参与手机导航 0是参与导航
        if (w_isShowChannel.Checked == true)
        {
            modelcolumn.w_isShowChannel = 1;          //是否参与手机导航 1是不参与导航
        }
        modelcolumn.w_linkUrl = this.w_linkUrl.Text;  //手机链接地址

        modelcolumn.w_intro   = this.w_intro.Text;    //手机站简介
        modelcolumn.w_content = this.w_content.Value; //手机站内容

        modelcolumn.e_isShowChannel = 0;              //是否参与英文导航 0是参与导航
        if (e_isShowChannel.Checked == true)
        {
            modelcolumn.e_isShowChannel = 1;                              //是否参与英文导航 1是不参与导航
        }
        modelcolumn.e_linkUrl = this.e_linkUrl.Text;                      //手英文链接地址

        modelcolumn.e_intro          = this.e_intro.Text;                 //英文站简介
        modelcolumn.e_content        = this.e_content.Value;              //英文站内容
        modelcolumn.e_seoTitle       = this.e_seoTitle.Text.Trim();       //英文站SEO标题
        modelcolumn.e_seoKeyword     = this.e_seoKeyword.Text.Trim();     //英文站SEO关键字
        modelcolumn.e_seoDescription = this.e_seoDescription.Text.Trim(); //英文站SEO描述

        if (cbIsAlbums.Checked == true)
        {
            modelcolumn.is_albums = 1;
        }
        if (cbIsAttach.Checked == true)
        {
            modelcolumn.is_attach = 1;
        }

        modelcolumn.page_size = Utils.StrToInt(txtPageSize.Text.Trim(), 10);

        #region 添加频道扩展字段========================
        List <Cms.Model.C_Column_field> ls = new List <Cms.Model.C_Column_field>();
        for (int i = 0; i < cblAttributeField.Items.Count; i++)
        {
            if (cblAttributeField.Items[i].Selected)
            {
                ls.Add(new Cms.Model.C_Column_field {
                    channel_id = modelcolumn.classId, field_id = Utils.StrToInt(cblAttributeField.Items[i].Value, 0)
                });
            }
        }
        modelcolumn.channel_fields = ls;
        #endregion

        if (bllcolumn.Update(modelcolumn))
        {
            adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改" + this.className.Text.Trim()); //记录日志
            JscriptMsg("修改栏目信息成功!", "SinglePage_edit.aspx?action=edit&classid=" + this.Request.QueryString["classId"] + "&parentId=" + this.Request.QueryString["parentId"] + "", "Success");
        }
        else
        {
            JscriptMsg("修改栏目信息失败!", "SinglePage_edit.aspx", "Error");
        }
    }
Example #12
0
    public string ListControl_Bind(int n)
    {
        string     role_id   = "";
        string     role_type = "";
        HttpCookie cookie    = System.Web.HttpContext.Current.Request.Cookies["admin"];

        if (cookie != null)
        {
            role_id   = (string)cookie.Values["adminid"];
            role_type = (string)cookie.Values["adminType"];
        }
        else if (Session["adminid"] != null)
        {
            role_id   = (string)Session["adminid"];
            role_type = (string)Session["adminType"];
        }
        Cms.BLL.C_admin_role_value bllrole_value = new Cms.BLL.C_admin_role_value();


        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dt          = bllcolumn.GetList("parentId=" + n + "and isHidden=0 order by orderNumber desc");
        string             Temphtml    = "";

        dt.Tables[0].Columns.Add("Operate", typeof(string)); //操作
        dt.Tables[0].Columns.Add("Colum", typeof(String));   //在dt中增加字段名为Colum的列
        if (dt.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
            {
                DataRow dr      = dt.Tables[0].Rows[i];
                string  strchar = "";
                string  modelid = dr["modelId"].ToString();
                string  strhref = "";
                if (modelid == "2")//文章模型
                {
                    strhref = "article/articlelist.aspx?classid=" + dr["classid"].ToString();
                }
                else if (modelid == "3")//产品模型
                {
                    strhref = "article/productList.aspx?action=edit&classid=" + dr["classid"].ToString() + "&parentId=" + dr["parentId"].ToString();
                }
                else if (modelid == "4")//单页模型
                {
                    strhref = "settings/SinglePage_edit.aspx?action=edit&classid=" + dr["classid"].ToString() + "&parentId=" + dr["parentId"].ToString();
                }
                else if (modelid == "5")
                {
                    strhref = "article/integralList.aspx?classid=" + dr["classid"].ToString();
                }
                else
                {
                    strhref = dr["listinfopath"].ToString() == "" ? "javascript:void(0);" : dr["listinfopath"].ToString();
                }
                DataSet ds = null;
                if (role_type == "1")
                {
                    ds = dt;
                }
                else
                {
                    ds = bllrole_value.GetList("nav_name='" + dr["className"] + "' and role_id=" + Convert.ToInt32(role_id));
                }
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    strchar += " <li><a class='item' target='mainframe' href='" + strhref + "'>" + dr["className"] + "</a><ul>";
                    strchar += InitChild(dr);
                    strchar += "</ul></li>";

                    Temphtml += strchar;
                    //this.files.InnerHtml = Temphtml;
                }
                else
                {
                    Temphtml += strchar;
                    //this.files.InnerHtml = Temphtml;
                }
            }
        }

        this.RepeaterColum.DataSource = dt;
        this.RepeaterColum.DataBind();
        return(Temphtml.ToString());
    }
Example #13
0
    private string InitChild(DataRow dr)
    {
        string     role_id   = "";
        string     role_type = "";
        HttpCookie cookie    = System.Web.HttpContext.Current.Request.Cookies["admin"];

        if (cookie != null)
        {
            role_id   = (string)cookie.Values["adminid"];
            role_type = (string)cookie.Values["adminType"];
        }
        else if (Session["adminid"] != null)
        {
            role_id   = (string)Session["adminid"];
            role_type = (string)Session["adminType"];
        }
        Cms.BLL.C_admin_role_value bllrole_value = new Cms.BLL.C_admin_role_value();

        Cms.BLL.C_Column   bllcolumn   = new Cms.BLL.C_Column();
        Cms.Model.C_Column modelcolumn = new Cms.Model.C_Column();
        DataSet            dtt         = bllcolumn.GetList("parentId=" + dr["classid"] + "and isHidden=0 order by orderNumber desc");

        dtt.Tables[0].Columns.Add("Operate", typeof(string));
        dtt.Tables[0].Columns.Add("Colum", typeof(String));
        string temp    = "";
        string strchar = "";

        if (dtt.Tables[0].Rows.Count > 0)
        {
            for (int k = 0; k < dtt.Tables[0].Rows.Count; k++)
            {
                DataRow          dro        = dtt.Tables[0].Rows[k];
                Cms.BLL.C_Column bllcolumn1 = new Cms.BLL.C_Column();
                DataSet          dtt1       = bllcolumn1.GetList("parentId=" + dro["classid"] + "and isHidden=0 order by orderNumber desc");
                if (dtt1.Tables[0].Rows.Count > 0)
                {
                    DataRow dro1    = dtt.Tables[0].Rows[k];
                    string  modelid = dro["modelId"].ToString();
                    string  strhref = "";
                    if (modelid == "2")//文章模型
                    {
                        strhref = "article/articlelist.aspx?classid=" + dro["classid"].ToString();
                    }
                    else if (modelid == "3")//产品模型
                    {
                        strhref = "article/productList.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString();
                    }
                    else if (modelid == "4")//单页模型
                    {
                        strhref = "settings/SinglePage_edit.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString();
                    }
                    else if (modelid == "5")
                    {
                        strhref = "article/integralList.aspx?classid=" + dro["classid"].ToString();
                    }
                    else
                    {
                        strhref = dro["listinfopath"].ToString() == "" ? "javascript:void(0);" : dro["listinfopath"].ToString();
                    }
                    DataSet ds = null;
                    if (role_type == "1")
                    {
                        ds = dtt;
                    }
                    else
                    {
                        ds = bllrole_value.GetList("nav_name='" + dro["className"] + "' and role_id=" + Convert.ToInt32(role_id));
                    }

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        strchar += " <li><a class='item' href='" + strhref + "'  target='mainframe'>" + dro["className"].ToString() + "</a><ul>";
                        strchar += InitChild(dro1);
                        strchar += "</ul></li>";
                    }
                }
                else
                {
                    string modelid = dro["modelId"].ToString();
                    string strhref = "";
                    if (modelid == "2")//文章模型
                    {
                        strhref = "article/articlelist.aspx?classid=" + dro["classid"].ToString();
                    }
                    else if (modelid == "3")//产品模型
                    {
                        strhref = "article/productList.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString();
                    }
                    else if (modelid == "4")//单页模型
                    {
                        strhref = "settings/SinglePage_edit.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString();
                    }
                    else if (modelid == "5")
                    {
                        strhref = "article/integralList.aspx?action=edit&classid=" + dro["classid"].ToString() + "&parentId=" + dro["parentId"].ToString();
                    }
                    else
                    {
                        strhref = dro["listinfopath"].ToString() == "" ? "javascript:void(0);" : dro["listinfopath"].ToString();
                    }
                    DataSet ds = null;
                    if (role_type == "1")
                    {
                        ds = dtt;
                    }
                    else
                    {
                        ds = bllrole_value.GetList("nav_name='" + dro["className"] + "' and role_id=" + Convert.ToInt32(role_id));
                    }


                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        temp += "<li>";
                        temp += "<a  class='item' target='mainframe'  href='" + strhref + "'>" + dro["className"].ToString() + "</a>";
                        temp += "</li>";
                    }
                }
            }
        }
        return(strchar + temp);
    }
Example #14
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Cms.Model.C_Column model)
 {
     return(dal.Update(model));
 }
Example #15
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Cms.Model.C_Column model)
 {
     return(dal.Add(model));
 }