Exemple #1
0
        /// <summary>
        /// 将信件按照指定字段进行排序
        /// </summary>
        protected void DataGrid_Sort(Object Src, DataGridSortCommandEventArgs E)
        {
            SortRule = (SortRule == "Desc")?"Asc":"Desc";
            SortBy   = E.SortExpression;
            DocumentClass doc       = new DocumentClass();
            DataTable     datatable = Tools.ConvertDataReaderToDataTable(doc.GetDocListInClass(Int32.Parse(ClassID), Username, Int32.Parse(DisplayType)));
            DataView      Source    = datatable.DefaultView;

            Source.Sort          = SortBy + " " + SortRule;
            doc                  = null;
            dgDocList.DataSource = Source;
            dgDocList.DataBind();
        }
Exemple #2
0
        /// <summary>
        /// 将某用户的邮件取出绑定至DataGrid
        /// </summary>
        protected void BindGrid()
        {
            UserCookie = Request.Cookies["Username"];
            string        Username  = UserCookie.Value.ToString();
            DocumentClass doc       = new DocumentClass();
            SqlDataReader dr        = doc.GetDocListInClass(Int32.Parse(ClassID), Username, Int32.Parse(DisplayType));
            DataTable     datatable = Tools.ConvertDataReaderToDataTable(dr);
            DataView      source    = datatable.DefaultView;

            source.Sort          = SortBy + " " + SortRule;
            dgDocList.DataSource = source;
            dgDocList.DataBind();
//
//			if (datatable.Rows.Count !=0)
//			{
//				this.lnkbtnDelete.Visible =true;
//
//			}
            doc       = null;
            datatable = null;
        }