protected void btnDel_Click(object sender, EventArgs e) { Repeater list = (Repeater)VoteSubjectIpList1.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.VoteModule.Domain.VoteSubjectIp domainVoteSubjectIp = new ZhuJi.Modules.VoteModule.Domain.VoteSubjectIp(); domainVoteSubjectIp.Id = int.Parse(id); ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectIp voteSubjectIp = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.VoteModule.NHibernateDAL.VoteSubjectIp)) as ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectIp; voteSubjectIp.Delete(domainVoteSubjectIp); Response.Redirect(Request.Url.ToString(), true); } catch (Exception ex) { ShowMessage(ex); } }
protected void btnDel_Click(object sender, EventArgs e) { Repeater list = (Repeater)VoteSubjectIpList1.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.VoteModule.Domain.VoteSubjectIp domainVoteSubjectIp = new ZhuJi.Modules.VoteModule.Domain.VoteSubjectIp(); domainVoteSubjectIp.Id = int.Parse(id); ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectIp voteSubjectIp = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.VoteModule.NHibernateDAL.VoteSubjectIp)) as ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectIp; voteSubjectIp.Delete(domainVoteSubjectIp); Response.Redirect(Request.Url.ToString(), true); } catch (Exception ex) { ShowMessage(ex); } }