protected void btnSave_Click(object sender, EventArgs e) { Core.Entity.Roles roles = new Core.Entity.Roles(); roles.RoleName = txtRoleName.Text; rolesManager.Add(roles); BindRolesGrid(); ResetControls(); }
protected void grvRoles_RowUpdating(object sender, GridViewUpdateEventArgs e) { int RoleId = Convert.ToInt32(grvRoles.DataKeys[e.RowIndex].Value.ToString()); GridViewRow row = (GridViewRow)grvRoles.Rows[e.RowIndex]; TextBox textRoleName = (TextBox)row.Cells[1].Controls[0]; Core.Entity.Roles roles = new Core.Entity.Roles(); roles.RoleId = RoleId; roles.RoleName = textRoleName.Text; rolesManager.Update(roles); grvRoles.EditIndex = -1; BindRolesGrid(); }