예제 #1
0
        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.tPicture BLL = new Maticsoft.BLL.tPicture();
            if (Tid == 0)
            {
                Grid.RecordCount = BLL.GetRecordCount(String.Format(" Name like '%{0}%' ", txtVal));
                Grid.DataSource  = BLL.GetListByPage(String.Format(" Name like '%{0}%' ", txtVal), " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            else
            {
                Grid.RecordCount = BLL.GetRecordCount(String.Format(" Name like '%{0}%' and PicTyID=" + Tid, txtVal));
                Grid.DataSource  = BLL.GetListByPage(String.Format(" Name like '%{0}%' and PicTyID=" + Tid, txtVal), " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }

            Grid.DataBind();
        }
예제 #2
0
        protected void GetView()
        {
            int Tid = 0;

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

            Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture();
            if (Tid == 0)
            {
                Grid.RecordCount = BLL.GetRecordCount("");
                Grid.DataSource  = BLL.GetListByPage("", " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            else
            {
                Grid.RecordCount = BLL.GetRecordCount(" PicTyID=" + Tid);
                Grid.DataSource  = BLL.GetListByPage(" PicTyID=" + Tid, " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
            }
            Grid.DataBind();
        }
예제 #3
0
 protected void BindGridByTid(int Tid)
 {
     Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture();
     if (Tid == 0)
     {
         Grid.RecordCount = BLL.GetRecordCount("");
         Grid.DataSource  = BLL.GetListByPage("", " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
     }
     else
     {
         Grid.RecordCount = BLL.GetRecordCount(" PicTyID=" + Tid);
         Grid.DataSource  = BLL.GetListByPage(" PicTyID=" + Tid, " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize);
     }
     Grid.DataBind();
 }
예제 #4
0
        public string GetPic(int tid, int top)
        {
            Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture();
            DataTable     dt           = BLL.GetListByPage(" PicTyID=" + tid, " Sort desc,Id desc ", 0, top).Tables[0];
            StringBuilder sb           = new StringBuilder();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sb.Append("<li>");
                sb.Append("<img src=" + dt.Rows[i]["Code"].ToString().Replace("~/", "../") + " />");
                sb.Append("</li>");
            }

            return(sb.ToString());
        }