コード例 #1
0
    private void DataPlay()
    {
        if (this.Request.QueryString["idea"] != null)
        {
            this.fdIdeaFieldName.Value = this.Request.QueryString["idea"].ToString();   //要赋值的意见域
        }

        this.fdCurrentSysUser.Value = this.Session["hyuid"].ToString();
        this.fdCurrentUserCh.Value = this.Session["hyuname"].ToString();
        this.fdCurrentTime.Value = System.DateTime.Now.ToString();

        HyoaClass.Hyoa_publicidea Hyoa_publicidea = new HyoaClass.Hyoa_publicidea();
        DataTable dt = Hyoa_publicidea.Getpublicideas();
        if (dt.Rows.Count > 0)
        {
            this.fdListCommonIdeas.DataSource = dt;
            this.fdListCommonIdeas.DataTextField = "hy_idea";
            this.fdListCommonIdeas.DataValueField = "hy_idea";
            this.fdListCommonIdeas.DataBind();
            this.fdListCommonIdeas.SelectedIndex = 0;
        }
        dt.Clear();
        HyoaClass.Hyoa_myidea Hyoa_myidea = new HyoaClass.Hyoa_myidea();
        DataTable dt2 = Hyoa_myidea.Getideasbyuserid(this.Session["hyuid"].ToString());
        if (dt2.Rows.Count > 0)
        {
            this.fdListCommonIdeas_Personal.DataSource = dt2;
            this.fdListCommonIdeas_Personal.DataTextField = "hy_idea";
            this.fdListCommonIdeas_Personal.DataValueField = "hy_idea";
            this.fdListCommonIdeas_Personal.DataBind();
            this.fdListCommonIdeas_Personal.SelectedIndex = 0;
        }
        dt2.Clear();
    }
コード例 #2
0
    private void DataPlay()
    {
        this.fdCurrentSysUser.Value = this.Session["hyuid"].ToString();
        this.fdCurrentUserCh.Value = this.Session["hyuname"].ToString();
        this.fdCurrentTime.Value = System.DateTime.Now.ToString();

        HyoaClass.Hyoa_publicidea Hyoa_publicidea = new HyoaClass.Hyoa_publicidea();
        DataTable dt = Hyoa_publicidea.Getpublicideas();
        if (dt.Rows.Count > 0)
        {
            this.fdListCommonIdeas.DataSource = dt;
            this.fdListCommonIdeas.DataTextField = "hy_idea";
            this.fdListCommonIdeas.DataValueField = "hy_idea";
            this.fdListCommonIdeas.DataBind();
            this.fdListCommonIdeas.SelectedIndex = 0;
        }
        HyoaClass.Hyoa_myidea Hyoa_myidea = new HyoaClass.Hyoa_myidea();
        DataTable dt2 = Hyoa_myidea.Getideasbyuserid(this.Session["hyuid"].ToString());
        if (dt2.Rows.Count > 0)
        {
            this.fdListCommonIdeas_Personal.DataSource = dt2;
            this.fdListCommonIdeas_Personal.DataTextField = "hy_idea";
            this.fdListCommonIdeas_Personal.DataValueField = "hy_idea";
            this.fdListCommonIdeas_Personal.DataBind();
            this.fdListCommonIdeas_Personal.SelectedIndex = 0;
        }
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.txtop.Value == "add")
        {
            this.txtid.Value = Hyoa_global.GetRandom();
        }
    }
コード例 #3
0
ファイル: list_gridea.aspx.cs プロジェクト: wjszxli/Webapp
    private void DataPlay(int PageNo)
    {
        ////判断当前用户是否有新建删除权限
        //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        //{
            this.isrole.Value = "1";
            this.tdnewdoc.Visible = true; //新建
            this.tddeldoc.Visible = true; //删除

        //}
        //else
        //{
        //    this.isrole.Value = "0";
        //    this.tdnewdoc.Visible = false; //新建
        //    this.tddeldoc.Visible = false; //删除
        //}

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_myidea Hyoa_myidea = new HyoaClass.Hyoa_myidea();

        DataTable dt;
        dt = Hyoa_myidea.Getideasbyuserid(this.Session["hyuid"].ToString());

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); 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);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }