protected void btnDel_Click(object sender, EventArgs e) { Repeater list = (Repeater)PermissionByMethodsList1.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.UUMS.Domain.PermissionByMethods domainPermissionByMethods = new ZhuJi.UUMS.Domain.PermissionByMethods(); domainPermissionByMethods.Id = int.Parse(id); ZhuJi.UUMS.IDAL.IPermissionByMethods permissionByMethods = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.PermissionByMethods)) as ZhuJi.UUMS.IDAL.IPermissionByMethods; permissionByMethods.Delete(domainPermissionByMethods); Response.Redirect(Request.Url.ToString(), true); } catch (Exception ex) { ShowMessage(ex); } }
/// <summary> /// 初始化编辑表单 /// </summary> private void Edit() { btnAdd.Visible = true; btnAdd.Text = "另存为新记录"; btnEdit.Visible = true; btnDel.Visible = true; try { ZhuJi.UUMS.IDAL.IPermissionByMethods permissionByMethods = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.PermissionByMethods)) as ZhuJi.UUMS.IDAL.IPermissionByMethods; ZhuJi.UUMS.Domain.PermissionByMethods domainPermissionByMethods = permissionByMethods.GetObject(_identity); UIMapping.BindObjectToControls(domainPermissionByMethods, this); } catch (Exception ex) { ShowMessage(ex); } }
/// <summary> /// 点击删除按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { try { ZhuJi.UUMS.Domain.PermissionByMethods domainPermissionByMethods = new ZhuJi.UUMS.Domain.PermissionByMethods(); domainPermissionByMethods.Id = int.Parse(Id.Text); ZhuJi.UUMS.IDAL.IPermissionByMethods permissionByMethods = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.PermissionByMethods)) as ZhuJi.UUMS.IDAL.IPermissionByMethods; permissionByMethods.Delete(domainPermissionByMethods); } catch (Exception ex) { ShowMessage(ex); } Response.Redirect(Request.Url.ToString(), true); }
/// <summary> /// 点击编辑按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnEdit_Click(object sender, EventArgs e) { if (Page.IsValid) { try { ZhuJi.UUMS.Domain.PermissionByMethods domainPermissionByMethods = new ZhuJi.UUMS.Domain.PermissionByMethods(); UIMapping.BindControlsToObject(domainPermissionByMethods, this); ZhuJi.UUMS.IDAL.IPermissionByMethods permissionByMethods = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.PermissionByMethods)) as ZhuJi.UUMS.IDAL.IPermissionByMethods; permissionByMethods.Update(domainPermissionByMethods); } catch (Exception ex) { ShowMessage(ex); } } }
/// <summary> /// 初始化查询列表 /// </summary> public void List() { try { ZhuJi.UUMS.IDAL.IPermissionByMethods permissionByMethods = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.PermissionByMethods)) as ZhuJi.UUMS.IDAL.IPermissionByMethods; rptList.DataSource = permissionByMethods.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 = permissionByMethods.GetRowCount; simplePager.DataBind(); } } catch (Exception ex) { ShowMessage(ex); } }