protected void GetView()
        {
            int Tid = 0;

            if (string.IsNullOrEmpty(TMailList.SelectedNodeID))
            {
                Tid = 0;
            }
            else
            {
                Tid = int.Parse(TMailList.SelectedNodeID);
            }

            Maticsoft.BLL.tArticle BLL = new Maticsoft.BLL.tArticle();
            if (Tid == 0)
            {
                Grid.RecordCount = BLL.GetRecordCount("");
                Grid.DataSource  = BLL.GetListByPage("", " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            else
            {
                Grid.RecordCount = BLL.GetRecordCount(" ArtTyID=" + Tid);
                Grid.DataSource  = BLL.GetListByPage(" ArtTyID=" + Tid, " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            Grid.DataBind();
        }
        protected void btnSelect_Click(object sender, EventArgs e)
        {
            string txtVal = this.txtValue.Text.Trim();

            if (txtVal == "")
            {
                GetView();
            }


            int Tid = 0;

            if (string.IsNullOrEmpty(TMailList.SelectedNodeID))
            {
                Tid = 0;
            }
            else
            {
                Tid = int.Parse(TMailList.SelectedNodeID);
            }

            Maticsoft.BLL.tArticle BLL = new Maticsoft.BLL.tArticle();
            if (Tid == 0)
            {
                Grid.RecordCount = BLL.GetRecordCount(String.Format(" Title like '%{0}%' ", txtVal));
                Grid.DataSource  = BLL.GetListByPage(String.Format(" Title like '%{0}%' ", txtVal), " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            else
            {
                Grid.RecordCount = BLL.GetRecordCount(String.Format(" Title like '%{0}%' and ArtTyID=" + Tid, txtVal));
                Grid.DataSource  = BLL.GetListByPage(String.Format(" Title like '%{0}%' and ArtTyID=" + Tid, txtVal), " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }

            Grid.DataBind();
        }
 protected void BindGridByTid(int Tid)
 {
     Maticsoft.BLL.tArticle BLL = new Maticsoft.BLL.tArticle();
     if (Tid == 0)
     {
         Grid.RecordCount = BLL.GetRecordCount("");
         Grid.DataSource  = BLL.GetListByPage("", " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
     }
     else
     {
         Grid.RecordCount = BLL.GetRecordCount(" ArtTyID=" + Tid);
         Grid.DataSource  = BLL.GetListByPage(" ArtTyID=" + Tid, " Sort desc,UpdateTime desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
     }
     Grid.DataBind();
 }