Beispiel #1
0
        public void preencheDGV()
        {
            Camadas.BLL.Bll_Chave             bll_Chave = new Camadas.BLL.Bll_Chave();
            List <Camadas.MODEL.Model_Chaves> lst_Chave = new List <Camadas.MODEL.Model_Chaves>();

            lst_Chave = bll_Chave.SelectbyDispo();

            DGV_chaves_Dispo.DataSource = lst_Chave;
            DGV_chaves_Dispo.Refresh();
        }
Beispiel #2
0
        public void chavesDisponiveis()
        {
            Camadas.BLL.Bll_Chave             bll_Chave = new Camadas.BLL.Bll_Chave();
            List <Camadas.MODEL.Model_Chaves> lst_Chave = new List <Camadas.MODEL.Model_Chaves>();

            lst_Chave = bll_Chave.SelectbyDispo();

            int Max_lst = lst_Chave.Count;

            Lbl_N_Chaves.Text = "" + Max_lst;
        }
Beispiel #3
0
        public void getChaveID()
        {
            Camadas.BLL.Bll_Chave             bll_Chave = new Camadas.BLL.Bll_Chave();
            List <Camadas.MODEL.Model_Chaves> lst_Chave = new List <Camadas.MODEL.Model_Chaves>();

            lst_Chave = bll_Chave.SelectByNumero(CB_Chave.Text);
            if (lst_Chave.Count > 0)
            {
                model_Chave = lst_Chave[0];
                ID_Chave    = model_Chave.id;
            }
        }
Beispiel #4
0
        public void CarregaCBChave()
        {
            Camadas.BLL.Bll_Chave             bll_Chave = new Camadas.BLL.Bll_Chave();
            List <Camadas.MODEL.Model_Chaves> lst_Chave = new List <Camadas.MODEL.Model_Chaves>();

            lst_Chave = bll_Chave.SelectbyDispo();
            int Max = lst_Chave.Count;

            for (int i = 0; i < Max; i++)
            {
                model_Chave = lst_Chave[i];
                CB_Chave.Items.Add(model_Chave.desc);
            }
        }
Beispiel #5
0
        public void vereicaDisponibilidadeAndInsert()
        {
            if (add == 1)
            {
                Camadas.BLL.Bll_Chave             bllChave  = new Camadas.BLL.Bll_Chave();
                List <Camadas.MODEL.Model_Chaves> lst_Chave = new List <Camadas.MODEL.Model_Chaves>();
                lst_Chave = bllChave.SelectByNumero(Txt_Parametro1.Text);
                if (lst_Chave.Count > 0)
                {
                    MessageBox.Show("Erro Chave ja cadastrada!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (MessageBox.Show("Deseja Adicionar esta chave?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Camadas.MODEL.Model_Chaves chave = new Camadas.MODEL.Model_Chaves();

                        chave.desc     = Txt_Parametro1.Text;
                        chave.situacao = Convert.ToString("disponivel");
                        chave.armario  = Convert.ToInt32(Txt_Parametro1.Text);

                        bllChave.Insert(chave);
                    }
                }
            }
            else
            {
                if (add == 2)
                {
                    Camadas.BLL.Bll_Aluno             bll_ALuno = new Camadas.BLL.Bll_Aluno();
                    List <Camadas.MODEL.Model_Alunos> lst_Aluno = new List <Camadas.MODEL.Model_Alunos>();
                    lst_Aluno = bll_ALuno.SelectbyRA(Convert.ToInt32(Txt_Parametro1.Text));
                    if (lst_Aluno.Count > 0)
                    {
                        MessageBox.Show("Erro Aluno ja cadastrado!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        if (MessageBox.Show("Deseja adicionar este aluno?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            int id_turma;

                            Camadas.BLL.Bll_Turma            bll_turma = new Camadas.BLL.Bll_Turma();
                            List <Camadas.MODEL.Model_Turma> lst_Turma = new List <Camadas.MODEL.Model_Turma>();
                            lst_Turma   = bll_turma.SelectbyDesc(CB_Parametro5.Text);
                            model_Turma = lst_Turma[0];
                            id_turma    = model_Turma.id;

                            Camadas.MODEL.Model_Alunos aluno = new Camadas.MODEL.Model_Alunos();

                            aluno.ra       = Convert.ToInt32(Txt_Parametro1.Text);
                            aluno.nome     = Txt_Parametro2.Text;
                            aluno.email    = Txt_Parametro3.Text;
                            aluno.telefone = Mak_Parametro4.Text;
                            aluno.fk_Turma = id_turma;
                            bll_ALuno.Insert(aluno);
                        }
                    }
                }
                else
                {
                    Camadas.BLL.Bll_Turma            bll_turma = new Camadas.BLL.Bll_Turma();
                    List <Camadas.MODEL.Model_Turma> lst_Turma = new List <Camadas.MODEL.Model_Turma>();
                    lst_Turma = bll_turma.SelectbyDesc(Txt_Parametro1.Text);
                    if (lst_Turma.Count > 0)
                    {
                        MessageBox.Show("Erro Turma ja cadastrada!");
                    }
                    else
                    {
                        if (MessageBox.Show("Deseja Adicionar esta turma?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            Camadas.MODEL.Model_Turma turma = new Camadas.MODEL.Model_Turma();

                            turma.Descricao = Convert.ToInt32(Txt_Parametro1.Text);

                            bll_turma.Insert(turma);
                        }
                    }
                }
            }
            limpa();
            Txt_Parametro1.Focus();
        }
Beispiel #6
0
 public void preencheDGV()
 {
     Camadas.BLL.Bll_Chave bll_Chave = new Camadas.BLL.Bll_Chave();
     DGV_Chave_Alugada.DataSource = bll_Chave.SelectbyAlugada();
 }