public int EliminarADESCOS(ADESCO pADESCOS) { ADESCO tmpADESCOS = BuscarADESCOS(pADESCOS); BDComun.Contexto.ADESCOS.Remove(tmpADESCOS); return BDComun.Contexto.SaveChanges(); }
private void txtNombreADESCO_TextChanged(object sender, TextChangedEventArgs e) { ADESCO _adesco = new ADESCO(); _adesco.Nombre = txtNombreADESCO.Text; dgADESCO.ItemsSource = _adescoBL.ObtenerADESCOSPorNombre(_adesco); }
//Boton Buscar Adesco private void btnBuscar_Click(object sender, RoutedEventArgs e) { BuscarADESCO _bus = new BuscarADESCO(); _bus.ShowDialog(); _adescoB = _bus.AdescoE; txtAdesco.Text = _adescoB.Nombre; }
public int ModificarADESCOS(ADESCO pADESCO) { ADESCO tmpADESCOS = BuscarADESCOS(pADESCO); tmpADESCOS.Id = pADESCO.Id; tmpADESCOS.Nombre = pADESCO.Nombre; tmpADESCOS.TipoADESCO = pADESCO.TipoADESCO; return BDComun.Contexto.SaveChanges(); }
public void TestModificarAdesco() { DataConexion _conexion = new DataConexion(); ADESCOBL _adescobl = new ADESCOBL(); ADESCO _adesco = new ADESCO(); _adesco.Nombre="Adescotur"; _adesco.TipoADESCO = "Rural"; _adesco.Id=2; int expected=1; int actual=_adescobl.ModificarADESCOS(_adesco); Assert.AreEqual(expected, actual); }
public void TestMostrarAdesco() { DataConexion _conexion = new DataConexion(); ADESCOBL _adescobl = new ADESCOBL(); ADESCO _adesco = new ADESCO(); { List<ADESCO> _ListaADESCOS = _adescobl.ObtenerADESCOS(); int expected = 0; int actual = _ListaADESCOS.Count; Assert.AreNotEqual(expected, actual); } }
public void TestAgregarAdesco() { DataConexion _conexion = new DataConexion(); ADESCOBL _adescobl = new ADESCOBL(); ADESCO _adesco = new ADESCO(); _adesco.Nombre = "ADESCOMER"; _adesco.TipoADESCO = "Urbana"; int expected = 1; int actual; actual = _adescobl.AgregarADESCOS(_adesco); Assert.AreEqual(expected, actual); }
public void TestEliminarAdesco() { DataConexion _conexion = new DataConexion(); ADESCOBL _adescobl = new ADESCOBL(); { ADESCO _adesco = new ADESCO(); _adesco.Id = 8; int expected = 1; int actual = _adescobl.EliminarADESCOS(_adesco); Assert.AreEqual(actual,expected); } }
private void dgADESCO_MouseDoubleClick_1(object sender, MouseButtonEventArgs e) { AdescoE = dgADESCO.SelectedItem as ADESCO; DialogResult = true; }
public List<ADESCO> ObtenerADESCOSPorNombre(ADESCO pADESCO) { return BDComun.Contexto.ADESCOS.Where(c => c.Nombre.Contains(pADESCO.Nombre)).ToList(); }
public ADESCO BuscarADESCOS(ADESCO pADESCO) { return BDComun.Contexto.ADESCOS.SingleOrDefault(c => c.Id == pADESCO.Id); }