public void TestGet() { SpaceCoffee spaceC2 = new SpaceCoffee(); spaceC2.Name = "Sala dois"; spaceCBLL.Insert(spaceC2); SingleResponse <SpaceCoffee> response = spaceCBLL.Get(spaceC2); Assert.AreEqual(true, response.Success); }
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; } }