private void btnConsultarTipoMaterial_Click(object sender, EventArgs e) { Point posicaoForm = new Point(100, 100); posicaoForm = this.Location; Form formConsultarTipoMaterial = new ConsultarTipoMaterial(this, posicaoForm.X, posicaoForm.Y, permissaoUsuario); this.Hide(); formConsultarTipoMaterial.Show(); }
private void btnAlterar_Click(object sender, EventArgs e) { //Validando os textos string descricao = txtDescricao.Text.ToString().Trim(); string descricaoReduzida = txtDescricaoReduzida.Text.ToString().Trim(); Boolean statusDescricao = validar.Textos(descricao); Boolean statusDescricaoReduzida = validar.Textos(descricaoReduzida); if (statusDescricao == true) { if (statusDescricaoReduzida == true) { int codigoTipoMaterial = int.Parse(cmbTipoMaterial.SelectedValue.ToString()); Boolean statusTipoMaterial = rdbAtivo.Checked == true; Boolean statusAlterar = camadaNegocios.AlterarTipoMaterial(codigoTipoMaterial, descricaoReduzida, descricao, statusTipoMaterial); if (statusAlterar == true) { MessageBox.Show("Tipo de material alterado com sucesso"); //Recarregando a página Point posicaoForm = new Point(100, 100); posicaoForm = this.Location; Form formConsultarTipoMaterial = new ConsultarTipoMaterial(formAnterior, posicaoForm.X, posicaoForm.Y, permissaoUsuario); xClicked = false; this.Close(); formConsultarTipoMaterial.Show(); } else { MessageBox.Show("Não foi possível alterar o tipo de material"); } } else { MessageBox.Show("Descrição reduzida inválida"); } } else { MessageBox.Show("Descrição inválida"); } }
private void btnCancelar_Click(object sender, EventArgs e) { //Recarregando a página Point posicaoForm = new Point(100, 100); posicaoForm = this.Location; Form formConsultarTipoMaterial = new ConsultarTipoMaterial(formAnterior, posicaoForm.X, posicaoForm.Y, permissaoUsuario); xClicked = false; this.Close(); formConsultarTipoMaterial.Show(); }