Exemplo n.º 1
0
        /// <summary>
        /// Allows to register a new bus
        /// </summary>
        /// <param name="t">Object type Unidad which will be registered</param>
        public void registrarUnidad(Unidad u)
        {
            validarunidad(u);
            UnidadDAL m = new UnidadDAL();

            m.registrarUnidad(u);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows to charge a list of all routes
        /// </summary>
        /// <returns>list of routes</returns>
        public List <Ruta> cargarRutas()
        {
            UnidadDAL   m = new UnidadDAL();
            List <Ruta> n = m.cargarRutas();

            return(n);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Allows to charge a list of all buses
        /// </summary>
        /// <returns>list of buses</returns>
        public List <Unidad> cargarUnidades()
        {
            UnidadDAL     m = new UnidadDAL();
            List <Unidad> n = m.cargarUnidades();

            return(n);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Allows to charge a list of buses with the same route
        /// </summary>
        /// <param name="v">name of the route</param>
        /// <returns>list of buses with the same route</returns>
        public List <Unidad> cargarUnidadesRuta(string v)
        {
            UnidadDAL     m = new UnidadDAL();
            List <Unidad> d = m.cargarUnidadesRuta(v);

            return(d);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Allows to update information of a specific bus
        /// </summary>
        /// <param name="actual">code of the bus </param>
        /// <param name="u">Updated information of the bus</param>
        public void editarUnidades(string actual, Unidad u)
        {
            validarunidad(u);
            UnidadDAL m = new UnidadDAL();

            m.editarUnidades(actual, u);
        }
Exemplo n.º 6
0
        private void ListarUnidades()
        {
            UnidadDAL unidadDAL = new UnidadDAL();

            cbxUnidad.DataSource    = unidadDAL.MostrarUnidades().Tables[0];
            cbxUnidad.DisplayMember = "placa";
            cbxUnidad.ValueMember   = "id";
        }
Exemplo n.º 7
0
 public FormAgregarUnidad(bool agregar, bool editar)
 {
     unidadDAL = new UnidadDAL();
     InitializeComponent();
     labelagregarunidad.Visible = agregar;
     label7.Visible             = editar;//label editar unidad
     btnagregarunidad.Visible   = agregar;
     btneditarunidad.Visible    = editar;
 }
Exemplo n.º 8
0
        public FormUnidades()
        {
            unidadDAL = new UnidadDAL(); //Se crean el cliente para la base
            unidadBLL = new UnidadBLL(); //Se crea el molde para uso y llenado

            InitializeComponent();
            btnEditar.Visible      = false;
            buttoneliminar.Visible = false;
            LlenarGrid();
            //dataGridView1.Rows.Insert(0, "1", "AEO-159-54", "Volador", "3.5", "417029762", "El águila 564564161");
        }
Exemplo n.º 9
0
        /// <summary>
        /// Allows to  generate a LIST of Unidades with permission to travel
        /// </summary>
        /// <returns>LIST of Unidades with permission to travel</returns>
        public List <Unidad> UnidadesConPermiso()
        {
            List <Unidad> ze = new List <Unidad>();
            UnidadDAL     x  = new UnidadDAL();
            List <Unidad> z  = x.cargarUnidades();

            foreach (Unidad a in z)
            {
                if (Convert.ToDateTime(a.GSFechaVigencia).Date > DateTime.Now.Date)
                {
                    ze.Add(a);
                }
            }
            return(ze);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Allows to eliminate a specific bus
        /// </summary>
        /// <param name="nombre">Code of the bus that will be eliminate</param>
        public void eliminarUnidad(string nombre)
        {
            UnidadDAL m = new UnidadDAL();

            m.eliminarUnidad(nombre);
        }