private void FrmEditarMensalidade_Load(object sender, EventArgs e)
        {
            try
            {
                lpm = mpBLL.procurarPorIdMens((int)mU.id);

                BLL_Plano       pBLL = new BLL_Plano();
                List <MO_Plano> lP   = new List <MO_Plano>();
                string[]        row  = new string[5];

                lP = pBLL.procurarTodasAtivas();
                this.DGPlano.Rows.Clear();
                foreach (MO_Plano p in lP)
                {
                    row[0] = p.id.ToString();
                    row[1] = verificaSelecionado((int)p.id) ? "v" : "f";
                    row[2] = p.nome;
                    row[3] = p.valor.ToString();
                    row[4] = p.qtdAula.ToString();

                    this.DGPlano.Rows.Add(row);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
        private void BtnOk_Click(object sender, EventArgs e)
        {
            try
            {
                BLL_Plano pBLL = new BLL_Plano();
                pU.idUsu   = Program.userLogado.id;
                pU.nome    = this.TxtNome.Text;
                pU.valor   = double.Parse(this.TxtValor.Text);
                pU.qtdAula = int.Parse(this.TxtQuantidade.Text);
                pU.stat    = Status.ativo;

                pBLL.editar(pU);
                MessageBox.Show("Plano editado com sucesso!", "Atenção!");
                this.Close();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Exemple #3
0
        private void BtnOk_Click(object sender, EventArgs e)
        {
            try
            {
                BLL_Plano pBLL = new BLL_Plano();

                MO_Plano p = new MO_Plano();
                p.idUsu   = Program.userLogado.id;
                p.nome    = this.TxtNome.Text;
                p.valor   = Convert.ToDouble(this.TxtValor.Text);
                p.qtdAula = int.Parse(this.TxtQuantidade.Text);

                pBLL.inserir(p);
                MessageBox.Show("Plano adicionado com sucesso!", "Atenção!");
                this.Close();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Exemple #4
0
        private void btnExc_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Deseja mesmo excluir plano?", "Atenção!", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    BLL_Plano pBLL = new BLL_Plano();
                    MO_Plano  p    = new MO_Plano();
                    p.id      = int.Parse(this.DGPlanos.CurrentRow.Cells[0].Value.ToString());
                    p.idUsu   = int.Parse(this.DGPlanos.CurrentRow.Cells[1].Value.ToString());
                    p.nome    = this.DGPlanos.CurrentRow.Cells[2].Value.ToString();
                    p.valor   = double.Parse(this.DGPlanos.CurrentRow.Cells[3].Value.ToString());
                    p.qtdAula = int.Parse(this.DGPlanos.CurrentRow.Cells[4].Value.ToString());
                    p.stat    = Status.inativo;

                    pBLL.editar(p);
                    refreshGrid();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Exemple #5
0
        /// <summary>
        /// Atualiza o grid todo
        /// </summary>
        private void refreshGrid()
        {
            BLL_Plano       pBLL = new BLL_Plano();
            List <MO_Plano> lP   = new List <MO_Plano>();

            string[] row = new string[5];

            lP = pBLL.procurarTodasAtivas();
            this.DGPlanos.Rows.Clear();

            foreach (MO_Plano p in lP)
            {
                row[0] = p.id.ToString();
                row[1] = p.idUsu.ToString();
                row[2] = p.nome;
                row[3] = p.valor.ToString();
                row[4] = p.qtdAula.ToString();

                this.DGPlanos.Rows.Add(row);
            }
        }
        private void FrmAddMensalidade_Load(object sender, EventArgs e)
        {
            try
            {
                BLL_Plano       pBLL = new BLL_Plano();
                List <MO_Plano> lP   = new List <MO_Plano>();
                string[]        row  = new string[5];

                lP = pBLL.procurarTodasAtivas();
                this.DGPlano.Rows.Clear();
                foreach (MO_Plano p in lP)
                {
                    row[0] = p.id.ToString();
                    row[2] = p.nome;
                    row[3] = p.valor.ToString();
                    row[4] = p.qtdAula.ToString();

                    this.DGPlano.Rows.Add(row);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }