private void cmdCreate_Click(object sender, EventArgs e) { curIndex = grdViewUserLevel.RowCount; frmUserLevelDetail UserLevelDetailForm = new frmUserLevelDetail(); UserLevelDetailForm.txtUserLevel.Tag = string.Empty; UserLevelDetailForm.txtUserLevel.Text = string.Empty; UserLevelDetailForm.cmdSave.Tag = "Add"; UserLevelDetailForm.ShowDialog(); BindingUserLevel(); }
private void cmdEdit_Click(object sender, EventArgs e) { curIndex = grdViewUserLevel.GetDataSourceRowIndex(grdViewUserLevel.FocusedRowHandle); frmUserLevelDetail UserLevelDetailForm = new frmUserLevelDetail(); UserLevelDetailForm.txtUserLevel.Tag = drUserLevel.ItemArray[0].ToString(); UserLevelDetailForm.txtUserLevel.Text = drUserLevel.ItemArray[1].ToString(); UserLevelDetailForm.chkIsActive.EditValue = bool.Parse(drUserLevel.ItemArray[2].ToString()); UserLevelDetailForm.cmdSave.Tag = "Edit"; UserLevelDetailForm.ShowDialog(); BindingUserLevel(); }