Esempio n. 1
0
        public ActionResult AgregarTerrestre(Terrestre model, string modeloVeh, string sucursal)
        {
            string name    = TempData["username"].ToString();
            string nameRol = TempData["rol"].ToString();
            int    codUser = Int32.Parse(TempData["codUser"].ToString());

            ViewBag.name         = name;
            ViewBag.rol          = nameRol;
            TempData["username"] = name;
            TempData["rol"]      = nameRol;
            TempData["codUser"]  = codUser;

            DAOUsuario dataU  = DAOUsuario.getInstance();
            string     today  = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss tt");
            string     accion = "Registro Vehiculo Terrestre " + model.placa;

            dataU.insertarAccion(codUser, 1, today, accion);

            int          fkModelo   = Int32.Parse(modeloVeh);
            int          fkSucursal = Int32.Parse(sucursal);
            DAOTerrestre data       = DAOTerrestre.getInstance();

            data.insertarTerrestres(model.placa, model.serialMotor, model.capacidad, model.peso,
                                    model.descripcion, model.serialCarroceria, model.fechaCreacion, model.tipo, fkSucursal, fkModelo);
            List <Terrestre> terrestres = data.obtenerTerrestres();

            return(View("~/Views/Vehiculo/IndexVehiculo.cshtml", terrestres));
        }
Esempio n. 2
0
        public ActionResult EliminarTerrestre(Terrestre model)
        {
            string name    = TempData["username"].ToString();
            string nameRol = TempData["rol"].ToString();
            int    codUser = Int32.Parse(TempData["codUser"].ToString());

            ViewBag.name         = name;
            ViewBag.rol          = nameRol;
            TempData["username"] = name;
            TempData["rol"]      = nameRol;
            TempData["codUser"]  = codUser;

            DAOUsuario dataU  = DAOUsuario.getInstance();
            string     today  = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss tt");
            string     accion = "Elimino Vehiculo Terrestre " + model.placa;

            dataU.insertarAccion(codUser, 4, today, accion);

            //int cod = Int32.Parse(model.cod);
            DAOTerrestre data = DAOTerrestre.getInstance();

            data.eliminarTerrestre(model.placa);
            List <Terrestre> terrestres = data.obtenerTerrestres();

            return(View("~/Views/Vehiculo/IndexVehiculo.cshtml", terrestres));
        }
Esempio n. 3
0
        // GET: Vehiculo
        public ActionResult IndexVehiculo(string viewba)
        {
            string name    = TempData["username"].ToString();
            string nameRol = TempData["rol"].ToString();
            int    codUser = Int32.Parse(TempData["codUser"].ToString());

            ViewBag.name         = name;
            ViewBag.rol          = nameRol;
            TempData["username"] = name;
            TempData["rol"]      = nameRol;
            TempData["codUser"]  = codUser;

            DAOUsuario dataU  = DAOUsuario.getInstance();
            string     today  = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss tt");
            string     accion = "Vehiculos Index";

            dataU.insertarAccion(codUser, 2, today, accion);

            ViewBag.name = viewba;
            DAOTerrestre     data      = DAOTerrestre.getInstance();
            List <Terrestre> terrestre = data.obtenerTerrestres();

            return(View(terrestre));
        }