/// <summary> /// 列表 /// </summary> /// <returns></returns> protected string GetList() { ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table(); ShowShop.BLL.Accessories.Outofstock bll = new ShowShop.BLL.Accessories.Outofstock(); ChangeHope.DataBase.DataByPage dataPage = bll.GetList(); //第一步先添加表头 table.AddHeadCol("", "<input type=\"checkbox\" id=\"chkAll\" onclick=\"CheckAll(this.form)\" alt=\"全选/取消\" />选择"); table.AddHeadCol("", "缺货信息"); table.AddHeadCol("", "联系信息"); table.AddHeadCol("", "备注信息"); table.AddHeadCol("", "联系人"); table.AddHeadCol("", "操作"); table.AddRow(); //添加表的内容 if (dataPage.DataReader != null) { int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex"); if (curpage < 0) { curpage = 1; } int count = 0; while (dataPage.DataReader.Read()) { count++; string No = (15 * (curpage - 1) + count).ToString(); table.AddCol("<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["id"].ToString() + "\" />"); table.AddCol(dataPage.DataReader["proclassandname"].ToString()); table.AddCol("<textarea rows=\"6\" cols=\"8\" style=\"width:200px;\">" + ContactInfo(dataPage.DataReader["telphone"].ToString(), dataPage.DataReader["mobile"].ToString(), dataPage.DataReader["qq"].ToString(), dataPage.DataReader["email"].ToString(), dataPage.DataReader["msn"].ToString()) + "</textarea>"); table.AddCol(string.Format("<textarea rows=\"6\" cols=\"8\" style=\"width:120px;\">{0}</textarea>", dataPage.DataReader["content"].ToString())); table.AddCol(dataPage.DataReader["username"].ToString()); table.AddCol(string.Format("<a href='javascript:void(0)' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString())); table.AddRow(); } } string view = table.GetTable() + dataPage.PageToolBar; dataPage.Dispose(); dataPage = null; return view; }
private void Del(string id) { ShowShop.BLL.Accessories.Outofstock bll = new ShowShop.BLL.Accessories.Outofstock(); bll.Delete(id); Response.Write("ok"); }