private void btnCancelar_Click(object sender, EventArgs e) { FrmConsCategoria f = new FrmConsCategoria(); tBoxCategoria.Clear(); f.MdiParent = FrmMain.ActiveForm; f.Show(); }
private void btnProcurar_Click(object sender, EventArgs e) { FrmConsCategoria f = new FrmConsCategoria(); if (i.VerificaDisponibilidade(f.Name, FrmMain.ActiveForm)) { f.MdiParent = FrmMain.ActiveForm; f.Show(); f.StartPosition = FormStartPosition.CenterScreen; } }
private void btnExcluir_Click(object sender, EventArgs e) { tsCadStatus.Image = null; tsCadStatus.Text = ""; tempo.Start(); tsCadProgress.Value = 0; string mensagem = ""; ModCatergoria md = new ModCatergoria(); md.Categoria = Properties.Settings.Default.categoria; md.Id = Convert.ToInt32(Properties.Settings.Default.idCategoria); DALConexao cn = new DALConexao(DALDadosConexao.ConStr); BLLCategoria u = new BLLCategoria(cn); mensagem = u.ExcluirCategoria(md, tBoxCategoria.TextLength, tBoxCategoria.Text); if (mensagem.Contains("sucesso")) { MessageBox.Show(mensagem, "Sucesso", MessageBoxButtons.OK); tsCadStatus.Text = ""; tsCadStatus.Image = null; tsCadProgress.Value = 0; tBoxCategoria.Clear(); i.Novo(new Button[] { btnInserir, btnProcurar, btnEditar, btnExcluir, btnCancelar }); FrmConsCategoria f = new FrmConsCategoria(); f.MdiParent = FrmMain.ActiveForm; f.Show(); } else { tsCadStatus.Text = mensagem; tsCadStatus.Image = Properties.Resources.Aviso; tBoxCategoria.Text = md.Categoria; } tBoxCategoria.Focus(); }