Exemple #1
0
        public void TestGetByCoffeeID()
        {
            SpaceCoffee spaceC1 = new SpaceCoffee();

            spaceC1.ID = 1;
            TableResponse response = personBLL.GetAllByCoffeeID(spaceC1);

            Assert.AreEqual(true, response.Success);
        }
Exemple #2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (cboxFilter.Text == "Treinamento")
            {
                //chamar método para pegar o ID da sala: id
                SpaceTraining space = new SpaceTraining();
                space.Name        = dataGridView1.Rows[e.RowIndex].Cells["Nome"].Value.ToString();
                space.MaxCapacity = int.Parse(dataGridView1.Rows[e.RowIndex].Cells["LotaçãoMáxima"].Value.ToString());
                SpaceTrainingBLL spaceBLL        = new SpaceTrainingBLL();
                SingleResponse <SpaceTraining> r = spaceBLL.Get(space);
                SpaceTraining newSpace           = r.Data;

                //chamar método para apresentar participantes da etapa 1 e 2
                PersonBLL     personBLL = new PersonBLL();
                TableResponse r1        = personBLL.GetAllByStage1ID(newSpace);
                TableResponse r2        = personBLL.GetAllByStage2ID(newSpace);


                //list1:
                listBoxStage1.DataSource    = null;
                listBoxStage1.DataSource    = r1.DataTable;
                listBoxStage1.DisplayMember = "Nome";
                //list2:
                listBoxStage2.DataSource    = null;
                listBoxStage2.DataSource    = r2.DataTable;
                listBoxStage2.DisplayMember = "Nome";

                lblTitle.Text = "Mostrando participantes da sala de treinamento: " + space.Name;
            }
            else
            {
                //chamar método para pegar o ID do espaço de café: id
                SpaceCoffee space = new SpaceCoffee();
                space.Name = dataGridView1.Rows[e.RowIndex].Cells["Nome"].Value.ToString();
                SpaceCoffeeBLL spaceBLL        = new SpaceCoffeeBLL();
                SingleResponse <SpaceCoffee> r = spaceBLL.Get(space);
                SpaceCoffee newSpace           = r.Data;

                //chamar método para apresentar participantes do intervalo para café
                PersonBLL     personBLL = new PersonBLL();
                TableResponse r1        = personBLL.GetAllByCoffeeID(newSpace);

                //list1: select * from persons where coffeeid1 = id
                listBoxStage1.DataSource    = null;
                listBoxStage1.DataSource    = r1.DataTable;
                listBoxStage1.DisplayMember = "Nome";
                lblTitle.Text = "Mostrando participantes do espaço para café: " + space.Name;
            }
        }