private void TabGrupo_SelectedIndexChanged(object sender, EventArgs e) { if (TabGrupo.SelectedIndex == 1) { if (GridGrupos.CurrentRow != null) { if (GridGrupos.CurrentRow.Cells[0].Value.ToString() != "" && !StaFormEdicao) { IdGrupo = int.Parse(GridGrupos.CurrentRow.Cells[0].Value.ToString()); Paginas.SelectTab(0); PopularGrid(); } } else { MessageBox.Show("Não existe Grupo Selecionado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); TabGrupo.SelectTab(0); } } else { if (StaFormEdicao) { MessageBox.Show("Cadastro de Produtos em Edição", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); TabGrupo.SelectTab(1); } } }
private void BtnNovo_Click(object sender, EventArgs e) { if (FrmPrincipal.Perfil_Usuario.AlterarProduto == 0) { MessageBox.Show("Usuário não Autorizado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (TabGrupo.SelectedIndex == 0) { TabGrupo.SelectTab(1); } StaFormEdicao = true; Paginas.SelectTab(1); LimpaDados(); PopularGridItens(); FrmPrincipal.ControleBotoes(true); TxtIcmsIss.Value = 17; TxtReferencia.Enabled = true; TxtReferencia.Focus(); } }