Beispiel #1
0
 private void DeptBind()
 {
     this.ddldept.Items.Clear();
     this.ddldept.Items.Add(new ListItem("--请选择组织--", ""));
     TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
     DataTable dt = JpDepts.GetDepts_tree();
     foreach (DataRow dr in dt.Rows)
     {
         string Id = dr["deptid"].ToString();
         string Title = dr["deptname"].ToString().Trim();
         int classLayer = Convert.ToInt32(Id.Length / 3);
         if (classLayer == 1)
         {
             this.ddldept.Items.Add(new ListItem(Title, Id));
         }
         else
         {
             string ls_temp = "";
             for (int i = 0; i < (classLayer - 1); i++)
             {
                 ls_temp += "├ ";
             }
             ls_temp += Title;
             this.ddldept.Items.Add(new ListItem(ls_temp, Id));
         }
     }
 }
Beispiel #2
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        //this.txtKeywords.Text = this.keywords;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
        DataTable dt = JpDepts.GetDepts_tree();
        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();

        //翻页
        //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
        //        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string pageUrl = JpCommon.CombUrlTxt("list_bmxx.aspx", "page={0}&rnd={1}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }