コード例 #1
0
ファイル: ADESCOBL.cs プロジェクト: danL96/ProyectoSocial
        public int EliminarADESCOS(ADESCO pADESCOS)
        {
            ADESCO tmpADESCOS = BuscarADESCOS(pADESCOS);

            BDComun.Contexto.ADESCOS.Remove(tmpADESCOS);
            return BDComun.Contexto.SaveChanges();
        }
コード例 #2
0
        private void txtNombreADESCO_TextChanged(object sender, TextChangedEventArgs e)
        {
            ADESCO _adesco = new ADESCO();
            _adesco.Nombre = txtNombreADESCO.Text;

            dgADESCO.ItemsSource = _adescoBL.ObtenerADESCOSPorNombre(_adesco);
        }
コード例 #3
0
        //Boton Buscar Adesco
        private void btnBuscar_Click(object sender, RoutedEventArgs e)
        {
            BuscarADESCO _bus = new BuscarADESCO();
            _bus.ShowDialog();

            _adescoB = _bus.AdescoE;
            txtAdesco.Text = _adescoB.Nombre;
        }
コード例 #4
0
ファイル: ADESCOBL.cs プロジェクト: danL96/ProyectoSocial
        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();
        }
コード例 #5
0
 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);
 }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);

            }
        }
コード例 #9
0
 private void dgADESCO_MouseDoubleClick_1(object sender, MouseButtonEventArgs e)
 {
     AdescoE = dgADESCO.SelectedItem as ADESCO;
     DialogResult = true;
 }
コード例 #10
0
ファイル: ADESCOBL.cs プロジェクト: danL96/ProyectoSocial
 public List<ADESCO> ObtenerADESCOSPorNombre(ADESCO pADESCO)
 {
     return BDComun.Contexto.ADESCOS.Where(c => c.Nombre.Contains(pADESCO.Nombre)).ToList();
 }
コード例 #11
0
ファイル: ADESCOBL.cs プロジェクト: danL96/ProyectoSocial
 public ADESCO BuscarADESCOS(ADESCO pADESCO)
 {
     return BDComun.Contexto.ADESCOS.SingleOrDefault(c => c.Id == pADESCO.Id);
 }