コード例 #1
0
ファイル: News.aspx.cs プロジェクト: ichari/ichari
    private void BindDataForType()
    {
        DataTable dt = new DAL.Tables.T_NewsTypes().Open("", "Name = 'CPS新闻公告' or Name = 'CPS推广指南'", "[ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName);

            return;
        }

        ddlType.DataSource = dt;
        ddlType.DataTextField = "Name";
        ddlType.DataValueField = "ID";
        ddlType.DataBind();

        Type = Shove._Web.Utility.GetRequest("Type");

        if (Type == "2")
        {
            Shove.ControlExt.SetDownListBoxText(ddlType, "CPS推广指南");
        }
        else
        {
            Shove.ControlExt.SetDownListBoxText(ddlType, "CPS新闻公告");
        }
    }
コード例 #2
0
ファイル: global_News.aspx.cs プロジェクト: ichari/ichari
    /// <summary>
    /// 绑定新闻类型树
    /// </summary>
    private void BindDataForType()
    {
        DataTable dt = new DAL.Tables.T_NewsTypes().Open("", "SiteID = 1" , "[ID]");

        //if (dt == null)
        //{
        //    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName);

        //    return;
        //}

        tv.DataTable = dt;
        tv.DataBind();

        foreach (TreeNode tn in tv.Nodes)
        {
            tn.NavigateUrl = "";
        }

        string TypeID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("TypeID"), -1).ToString();

        if (TypeID != "-1")
        {
            Shove.ControlExt.SetTreeViewSelectedFromValue(tv, TypeID);
        }
        else if (tv.Nodes.Count > 0)
        {
            tv.Nodes[0].Select();
        }
    }
コード例 #3
0
ファイル: global_News_Add.aspx.cs プロジェクト: ichari/ichari
    private void BindDataForNewsTypes()
    {

        DataTable dt = new DAL.Tables.T_NewsTypes().Open("", "SiteID = 1", "[ID]");

        Shove.ControlExt.FillDropDownList(ddlTypes, dt, "Name", "ID");

        string TypeID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("TypeID"), -1).ToString();

        if (TypeID != "-1")
        {
            Shove.ControlExt.SetDownListBoxTextFromValue(ddlTypes, TypeID);
        }
    }
コード例 #4
0
    private void BindDataForType()
    {
        DataTable dt = new DAL.Tables.T_NewsTypes().Open("", "SiteID = 1" , "[ID]");

        //if (dt == null)
        //{
        //    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName);

        //    return;
        //}

        Shove.ControlExt.FillDropDownList(ddlTypes, dt, "Name", "ID");

        string TypeID = Shove._Web.Utility.GetRequest("TypeID");

        if (TypeID != "")
        {
            Shove.ControlExt.SetDownListBoxTextFromValue(ddlTypes, TypeID);
        }
    }
コード例 #5
0
ファイル: NewsAdd.aspx.cs プロジェクト: ichari/ichari
    private void BindDataForNewsTypes()
    {
        DataTable dt = new DAL.Tables.T_NewsTypes().Open("", "SiteID = " + _Site.ID.ToString(), "[ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName);

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlTypes, dt, "Name", "ID");

        string TypeID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("TypeID"), -1).ToString();

        if (TypeID != "-1")
        {
            Shove.ControlExt.SetDownListBoxTextFromValue(ddlTypes, TypeID);
        }
    }
コード例 #6
0
 private void BindDataForType()
 {
     DataTable table = new Tables.T_NewsTypes().Open("", "SiteID = " + base._Site.ID.ToString(), "[ID]");
     if (table == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
     }
     else
     {
         this.tv.DataTable = table;
         this.tv.DataBind();
         foreach (TreeNode node in this.tv.Nodes)
         {
             node.NavigateUrl = "";
             foreach (TreeNode node2 in node.ChildNodes)
             {
                 node2.NavigateUrl = "";
             }
         }
         string str = _Convert.StrToLong(Utility.GetRequest("TypeID"), -1L).ToString();
         if (str != "-1")
         {
             ControlExt.SetTreeViewSelectedFromValue(this.tv, str);
         }
         else if (this.tv.Nodes.Count > 0)
         {
             this.tv.Nodes[0].Select();
         }
     }
 }