protected void gvList_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { ZhuJi.UUMS.Domain.Roles domainRoles = new ZhuJi.UUMS.Domain.Roles(); domainRoles.Id = int.Parse(gvList.Rows[e.RowIndex].Cells[0].Text); ZhuJi.UUMS.IDAL.IRoles roles = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Roles)) as ZhuJi.UUMS.IDAL.IRoles; roles.Delete(domainRoles); gvList.EditIndex = -1; BindGrid(); } catch (Exception ex) { throw ex; } }
protected void gvList_RowInserting(object sender, EventArgs e) { try { ZhuJi.UUMS.Domain.Roles domainRoles = new ZhuJi.UUMS.Domain.Roles(); TextBox txtRoleName = (TextBox)gvList.FooterRow.FindControl("txtRoleName"); TextBox txtOrderBy = (TextBox)gvList.FooterRow.FindControl("txtOrderBy"); domainRoles.RoleName = txtRoleName.Text.Trim(); domainRoles.OrderBy = int.Parse(txtOrderBy.Text.Trim()); ZhuJi.UUMS.IDAL.IRoles roles = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.UUMS.NHibernateDAL.Roles)) as ZhuJi.UUMS.IDAL.IRoles; roles.Insert(domainRoles); gvList.EditIndex = -1; BindGrid(); } catch (Exception ex) { ShowMessage(ex); } }