protected void btnDel_Click(object sender, EventArgs e) { Repeater list = (Repeater)SkinList1.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.Portal.Domain.Skin domainSkin = new ZhuJi.Portal.Domain.Skin(); domainSkin.Id = int.Parse(id); ZhuJi.Portal.IDAL.ISkin skin = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Skin)) as ZhuJi.Portal.IDAL.ISkin; skin.Delete(domainSkin); Response.Redirect(Request.Url.ToString(), true); } catch (Exception ex) { ShowMessage(ex); } }
protected void btnEdit_Click(object sender, EventArgs e) { Repeater list = (Repeater)SkinList1.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; } Initialize(); pnlEdit.Visible = true; SkinEdit1.Identity = int.Parse(id); SkinEdit1.Command = "EDIT"; SkinEdit1.Initialize(); }