Beispiel #1
0
        public List <EN.Licencias> licenciasVencidas()
        {
            DateTime            dateTime = DateTime.Today.Date;
            List <BR.Licencias> query    = db.Licencias.Where(x => x.vencimiento >= dateTime).ToList();
            List <EN.Licencias> lic      = new List <EN.Licencias>();

            foreach (BR.Licencias other in query)
            {
                EN.Licencias licencia = new EN.Licencias(other.Numero_pase, other.Conductor.nombre.ToUpper(), other.Secretarias_transito.localidad, other.categoria, other.expedicon, other.vencimiento);
                lic.Add(licencia);
            }
            return(lic);
        }
Beispiel #2
0
        public List <EN.Licencias> mostrarLicencias()
        {
            var query = db.Licencias.ToList();
            List <EN.Licencias> lic = new List <EN.Licencias>();

            foreach (var other in query)
            {
                EN.Licencias licencia = new EN.Licencias();
                licencia.Numero_pase = other.Numero_pase;
                licencia.conductor   = other.Conductor.nombre.ToUpper();
                licencia.secretaria  = other.Secretarias_transito.localidad;
                licencia.categoria   = other.categoria;
                licencia.expedicon   = other.expedicon;
                licencia.vencimiento = other.vencimiento;
                lic.Add(licencia);
            }
            return(lic);
        }
Beispiel #3
0
        public EN.Licencias MostarLicencia(int Numero)
        {
            TextInfo myTI = CultureInfo.CurrentCulture.TextInfo;

            try
            {
                BR.Licencias other = db.Licencias.Where(x => x.Numero_pase == Numero).FirstOrDefault();
                if (other != null)
                {
                    EN.Licencias lic = new EN.Licencias(other.Numero_pase, other.Conductor.nombre.ToUpper() + " " + other.Conductor.apellido.ToUpper(), myTI.ToTitleCase(other.Secretarias_transito.localidad), other.categoria, other.expedicon, other.vencimiento);
                    return(lic);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        public EN.Licencias MostarLicenciaPorNombre(string nombre)
        {
            TextInfo myTI = CultureInfo.CurrentCulture.TextInfo;

            try
            {
                var conductor = db.Conductor.Where(x => x.nombre.Contains(nombre)).FirstOrDefault();

                if (conductor != null)
                {
                    BR.Licencias other = db.Licencias.Where(x => x.id_conductor == conductor.id).FirstOrDefault();
                    EN.Licencias lic   = new EN.Licencias(other.Numero_pase, other.Conductor.nombre.ToUpper() + " " + other.Conductor.apellido.ToUpper(), myTI.ToTitleCase(other.Secretarias_transito.localidad), other.categoria, other.expedicon, other.vencimiento);
                    lic.cedula = other.Conductor.cedula;
                    return(lic);
                }

                return(null);
            }
            catch (Exception)
            {
                throw null;
            }
        }