private void FxCancel() { TxtName.Text = ""; TxtUserName.Text = ""; ChkEnabled.Checked = false; TxtName.Enabled = false; TxtUserName.Enabled = false; ChkEnabled.Enabled = false; CmdSave.Enabled = false; if (lUserId == 0) { Text += " - Adicionar"; TxtName.Enabled = true; TxtUserName.Enabled = true; ChkEnabled.Checked = true; CmdSave.Enabled = true; TxtName.Focus(); } else { Text += " - Modificar"; DataTable ObjDt = ClsSqlAdministrator.Fx_sel_tblUser_detail(lUserId); if (ObjDt != null) { if (ObjDt.Rows.Count > 0) { TxtName.Text = ObjDt.Rows[0][0].ToString(); TxtUserName.Text = ObjDt.Rows[0][1].ToString(); ChkEnabled.Checked = ClsFunctions.FxConvertStringToBool(ObjDt.Rows[0][2].ToString()); TxtName.Enabled = true; TxtUserName.Enabled = true; ChkEnabled.Enabled = true; CmdSave.Enabled = true; TxtName.Focus(); } } } }