Esempio n. 1
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPTongXunLu MyModel = new ZWL.BLL.ERPTongXunLu();
        DataSet ds = new DataSet();

        if (Request.QueryString["TypeStr"].ToString().Trim() == "公共通讯簿")
        {
            ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");

            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|008A|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|008M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|008D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|008E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else if (Request.QueryString["TypeStr"].ToString().Trim() == "个人通讯簿")
        {
            ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and UserName='******' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|010A|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|010M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|010D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|010E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else
        {
            //所有共享的通讯录
            ds = MyModel.GetList("IfShare='是' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //隐藏添加、修改、删除
            this.ImageButton1.Visible = false;
            this.ImageButton5.Visible = false;
            this.ImageButton3.Visible = false;
            //设定按钮权限
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|009E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        if (ds != null)
        {
            GVData.DataSource = ds;
            GVData.DataBind();
            LabPageSum.Text     = Convert.ToString(GVData.PageCount);
            LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
            this.GoPage.Text    = LabCurrentPage.Text.ToString();
        }
    }
Esempio n. 2
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPTongXunLu MyModel = new ZWL.BLL.ERPTongXunLu();
        DataSet ds = new DataSet();
        if (Request.QueryString["TypeStr"].ToString().Trim() == "公共通讯簿")
        {
            ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");

            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|008A|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|008M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|008D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|008E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else if (Request.QueryString["TypeStr"].ToString().Trim() == "个人通讯簿")
        {
           ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and UserName='******' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|010A|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|010M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|010D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|010E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else
        {
            //所有共享的通讯录
            ds = MyModel.GetList("IfShare='是' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //隐藏添加、修改、删除
            this.ImageButton1.Visible = false;
            this.ImageButton5.Visible = false;
            this.ImageButton3.Visible = false;
            //设定按钮权限
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|009E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        if (ds != null)
        {
            GVData.DataSource = ds;
            GVData.DataBind();
            LabPageSum.Text = Convert.ToString(GVData.PageCount);
            LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
            this.GoPage.Text = LabCurrentPage.Text.ToString();
        }
    }
Esempio n. 3
0
    public void DataBindToGridview()
    {
        GVData.PageSize  = AspNetPager1.PageSize;
        GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1;
        ZWL.BLL.ERPTongXunLu MyModel = new ZWL.BLL.ERPTongXunLu();
        DataSet ds = new DataSet();

        if (Request.QueryString["TypeStr"].ToString().Trim() == "公共通讯簿")
        {
            ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");

            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|015a|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|015m|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|015d|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|015e|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else if (Request.QueryString["TypeStr"].ToString().Trim() == "个人通讯簿")
        {
            ds = MyModel.GetList("TypeStr='" + Request.QueryString["TypeStr"].ToString().Trim() + "' and UserName='******' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //设定按钮权限
            ImageButton1.Visible = ZWL.Common.PublicMethod.StrIFIn("|017a|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton5.Visible = ZWL.Common.PublicMethod.StrIFIn("|017m|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton3.Visible = ZWL.Common.PublicMethod.StrIFIn("|017d|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|017e|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        else
        {
            //所有共享的通讯录
            ds = MyModel.GetList("IfShare='是' and NameStr Like '%" + this.TextBox1.Text + "%' order by ID desc");
            //隐藏添加、修改、删除
            this.ImageButton1.Visible = false;
            this.ImageButton5.Visible = false;
            this.ImageButton3.Visible = false;
            //设定按钮权限
            ImageButton2.Visible = ZWL.Common.PublicMethod.StrIFIn("|016e|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
        GVData.DataSource = ds;
        GVData.DataBind();
        AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
    }