예제 #1
0
        // Get todos los residententes
        public List <Residente> GetResidenteDAL()
        {
            List <Residente> Recursos = new List <Residente>();

            using (SISGIV_Entities Re = new SISGIV_Entities())
            {
                Recursos = Re.Residente.ToList <Residente>();
            }
            return(Recursos);
        }
예제 #2
0
        // Get todos las casas
        public List <Casa> GetCasaDAL()
        {
            List <Casa> Casas = new List <Casa>();

            using (SISGIV_Entities Ca = new SISGIV_Entities())
            {
                Casas = Ca.Casa.ToList <Casa>();
            }
            return(Casas);
        }
예제 #3
0
        // Gat todos los recursos
        public List <Recurso> GetRecursoDAL()
        {
            List <Recurso> Recursos = new List <Recurso>();

            using (SISGIV_Entities Re = new SISGIV_Entities())
            {
                Recursos = Re.Recurso.ToList <Recurso>();
            }
            return(Recursos);
        }
예제 #4
0
        // Set casa
        public bool SetCasaDAL(Casa NewCasa)
        {
            bool Resultado = false;

            using (SISGIV_Entities Ca = new SISGIV_Entities())
            {
                Ca.Casa.Add(NewCasa);
                Ca.SaveChanges();

                Resultado = true;
            }

            return(Resultado);
        }
예제 #5
0
        // Set Residentes
        public bool SetResidenteDAL(Residente NewResidente)
        {
            bool Resultado = false;

            using (SISGIV_Entities Re = new SISGIV_Entities())
            {
                Re.Residente.Add(NewResidente);
                Re.SaveChanges();

                Resultado = true;
            }

            return(Resultado);
        }
예제 #6
0
        // Update Recurso
        public bool UpdateRecursoDAL(int IdUpdate, Recurso UpdateRecurso)
        {
            bool Resultado = false;

            using (SISGIV_Entities Re = new SISGIV_Entities())
            {
                var Rec = Re.Recurso.Where(x => x.IdRecurso == IdUpdate).ToList().Last();

                Rec.Nombre = UpdateRecurso.Nombre;
                Rec.Estado = UpdateRecurso.Estado;
                Rec.Tipo   = UpdateRecurso.Tipo;

                Re.SaveChanges();

                Resultado = true;
            }

            return(Resultado);
        }
예제 #7
0
        // Update Casa
        public bool UpdateCasaDAL(int IdUpdate, Casa UpdateCasa)
        {
            bool Resultado = false;

            using (SISGIV_Entities Ca = new SISGIV_Entities())
            {
                var Cas = Ca.Casa.Where(x => x.IdCasa == IdUpdate).ToList().Last();

                Cas.IdArea             = UpdateCasa.IdArea;
                Cas.IdResidente        = UpdateCasa.IdResidente;
                Cas.NumeroDeHabitantes = UpdateCasa.NumeroDeHabitantes;
                Cas.Telefono           = UpdateCasa.Telefono;
                Cas.Descripcion        = UpdateCasa.Descripcion;
                Cas.Letra  = UpdateCasa.Letra;
                Cas.Estado = UpdateCasa.Estado;

                Ca.SaveChanges();

                Resultado = true;
            }

            return(Resultado);
        }
예제 #8
0
        // Update Residente
        public bool UpdateResidenteDAL(int IdUpdate, Residente UpdateResidente)
        {
            bool Resultado = false;

            using (SISGIV_Entities Re = new SISGIV_Entities())
            {
                var Res = Re.Residente.Where(x => x.IdResidente == IdUpdate).ToList().Last();

                Res.Nombres   = UpdateResidente.Nombres;
                Res.Apellidos = UpdateResidente.Apellidos;
                Res.Edad      = UpdateResidente.Edad;
                Res.Telefono  = UpdateResidente.Telefono;
                Res.Correo    = UpdateResidente.Correo;
                Res.Estado    = UpdateResidente.Estado;
                Res.Cedula    = UpdateResidente.Cedula;

                Re.SaveChanges();

                Resultado = true;
            }

            return(Resultado);
        }