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