Ejemplo n.º 1
0
 private void SmilesGridBind()
 {
     #region 绑定数据
     string          emptySmilieList = Smilies.ClearEmptySmilieType();
     DataTable       dt      = Smilies.GetSmilieTypes();
     DirectoryInfo[] dirInfo = GetSmilesDirList();
     foreach (DirectoryInfo dir in dirInfo)
     {
         dirList.Add(dir.Name);
     }
     string d = "";
     foreach (DataRow dr in dt.Rows)
     {
         dirList.Remove(dr["url"]);
         d += dr["code"].ToString() + ",";
     }
     smilesgrid.TableHeaderName = "论坛表情列表";
     smilesgrid.BindData(DatabaseProvider.GetInstance().GetSmilies());
     ViewState["dir"]     = d;
     ViewState["dirList"] = dirList;
     if (emptySmilieList != "")
     {
         base.RegisterStartupScript("", "<script>alert('" + emptySmilieList + " 为空,已经被移除!');</script>");
     }
     #endregion
 }