protected void btnSave_Click(object sender, EventArgs e) { Rolemaster _objRm = new Rolemaster(); _objRm.RoleId = Convert.ToInt32(lblID.Text); _objRm.RoleName = txtRname.Text.Trim(); _objRm.IsActive = Chekacv.Checked; try { _objRm.Save(); MessageBox("Record saved successfully"); grdRoleDetails.DataSource = BindGvRoleDetail(); grdRoleDetails.DataBind(); pnlRoleDetails.Visible = true; PnlAddRole.Visible = false; btnSave.Visible = false; UPAddRole.Update(); upAction.Update(); UpdatePanel1.Update(); } catch { } }
protected void BtnAdd_Click(object sender, EventArgs e) { lblID.Text = "0"; txtRname.Text = ""; UPAddRole.Update(); PnlAddRole.Visible = true; pnlRoleDetails.Visible = false; }
protected void grdRoleDetails_RowEditing(object sender, GridViewEditEventArgs e) { pnlRoleDetails.Visible = false; PnlAddRole.Visible = true; lblID.Text = ((Label)grdRoleDetails.Rows[e.NewEditIndex].FindControl("lblRID")).Text; txtRname.Text = ((Label)grdRoleDetails.Rows[e.NewEditIndex].FindControl("lblName")).Text; Chekacv.Checked = ((CheckBox)grdRoleDetails.Rows[e.NewEditIndex].FindControl("chkisActive")).Checked; UPAddRole.Update(); upAction.Update(); btnSave.Visible = true; btnSave.Text = "Update"; Role = txtRname.Text; }