public void BindData() { this.smilesgrid.AllowCustomPaging = false; this.smilesgrid.TableHeaderName = "论坛表情列表"; //this.smilesgrid.BindData(Smilies.GetSmilieByType(DNTRequest.GetInt("typeid", 0))); this.smilesgrid.BindData <Smilie>(Smilie.FindAllByType(DNTRequest.GetInt("typeid", 0))); }
private void BindFilesList() { try { this.fileinfoList.Text = ""; var typeid = WebHelper.RequestInt("typeid"); var sm = Smilie.FindByID(typeid); if (sm != null) { this.fileList = this.GetSmilesFileList(sm.Url); string url = sm.Url; //var smilieByType = Smilies.GetSmilieByType(typeid); var list = Smilie.FindAllByType(sm.ID); foreach (var sm2 in list) { var viewState = this.ViewState; viewState["code"] = viewState["code"] + "" + sm2.Code + ","; this.fileList.Remove(sm2.Url.Replace(url + "/", "")); } this.fileList.Remove("Thumbs.db"); int num = 1; foreach (string text in this.fileList) { Literal expr_12C = this.fileinfoList; expr_12C.Text += "<tr class='mouseoutstyle' onmouseover='this.className=\"mouseoverstyle\"' onmouseout='this.className=\"mouseoutstyle\"'>\n"; Literal expr_147 = this.fileinfoList; object text2 = expr_147.Text; expr_147.Text = text2 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='checkbox' id='id" + num + "' name='id" + num + "' value='" + num + "'/></td>\n"; Literal expr_1B4 = this.fileinfoList; object text3 = expr_1B4.Text; expr_1B4.Text = text3 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='text' id='code" + num + "' name='code" + num + "' value=':" + url + (list.Count + num) + ":' class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" /></td>\n"; Literal expr_233 = this.fileinfoList; object text4 = expr_233.Text; expr_233.Text = text4 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='text' id='order" + num + "' name='order" + num + "' value='" + num + "' class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" size='4' /></td>\n"; Literal expr_2A0 = this.fileinfoList; object text5 = expr_2A0.Text; expr_2A0.Text = text5 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='hidden' name='url" + num + "' value='" + url + "/" + text + "' />" + url + "/" + text + "</td>\n"; Literal expr_323 = this.fileinfoList; expr_323.Text = expr_323.Text + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'>" + this.PicStr(sm.Url + "/" + text) + "</td>\n"; Literal expr_35B = this.fileinfoList; expr_35B.Text += "</tr>\n"; num++; } if (this.fileList.Count == 0) { this.SubmitButton.Visible = false; } } } catch (IOException ex) { base.RegisterStartupScript("", "<script>alert('" + ex.Message + "');window.location.href='forum_smiliemanage.aspx';</script>"); } }
protected void DelRec_Click(object sender, EventArgs e) { if (base.CheckCookie()) { string[] array = Request["id"].Split(','); if (this.smilesgrid.Items.Count == array.Length) { base.RegisterStartupScript("", "<script>alert('请至少保留一组默认表情,或者添加一组新表情后,再删除本组表情!');window.location.href='forum_smiliemanage.aspx';</script>"); return; } string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; AdminForums.DeleteSmilies(text, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip); this.smilesgrid.EditItemIndex = -1; this.SmilesGridBind(); Smilie.FindAllByType(int.Parse(text)).Delete(); } base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>"); } }