protected void btnDel_Click(object sender, EventArgs e) { Repeater list = (Repeater)ReviewList1.FindControl("rptList"); string id = UIControlHelper.GetCheckBoxByRepeater(list, "chkId"); if (id.Length == 0) { MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("NOCHECK")); return; } if (id.Split(',').Length > 1) { MessageHelper.ShowAndBack(Page, MessageHelper.GetMessage("MORECHECK")); return; } try { ZhuJi.Modules.CommentModule.Domain.Review domainReview = new ZhuJi.Modules.CommentModule.Domain.Review(); domainReview.Id = int.Parse(id); ZhuJi.Modules.CommentModule.IDAL.IReview review = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.CommentModule.NHibernateDAL.Review)) as ZhuJi.Modules.CommentModule.IDAL.IReview; review.Delete(domainReview); Response.Redirect(Request.Url.ToString(), true); } catch (Exception ex) { ShowMessage(ex); } }
/// <summary> /// 初始化查询列表 /// </summary> public void List() { try { ZhuJi.Modules.CommentModule.IDAL.IReview review = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.CommentModule.NHibernateDAL.Review)) as ZhuJi.Modules.CommentModule.IDAL.IReview; rptList.DataSource = review.GetObjects(base.Where, base.OrderNo, base.PageNo, base.PageSize); rptList.DataBind(); if (base.IsShowPager) { simplePager.Visible = true; simplePager.CurrentPage = base.PageNo; simplePager.PageSize = base.PageSize; simplePager.PageUrl = Request.Url.ToString(); simplePager.RecordCount = review.GetRowCount; simplePager.DataBind(); } } catch (Exception ex) { ShowMessage(ex); } }