示例#1
0
        public ActionResult ModificarBarco(Barco model, string modeloVeh, string puerto)
        {
            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 = "Modifico Barco " + model.placa;

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

            int      fkM  = Int32.Parse(modeloVeh);
            int      fkP  = Int32.Parse(puerto);
            DAOBarco data = DAOBarco.getInstance();

            data.modificarBarco(model.placa, model.serialMotor, model.capacidad, model.peso,
                                model.descripcion, model.serialCarroceria, model.fechaCreacion, model.nombre, fkM, fkP);
            List <Barco> Barcos = data.obtenerBarcos();

            return(View("~/Views/Vehiculo/Barco.cshtml", Barcos));
        }
示例#2
0
        //INDEX BARCO
        public ActionResult IndexBarco()
        {
            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 = "Barcos ";

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

            DAOBarco     data   = DAOBarco.getInstance();
            List <Barco> Barcos = data.obtenerBarcos();

            if (Barcos != null)
            {
                return(View("~/Views/Vehiculo/Barco.cshtml", Barcos));
            }
            else
            {
                return(View("~/Views/Vehiculo/Barco.cshtml"));
            }
        }
示例#3
0
        public ActionResult EliminarBarco(Barco 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 Barco " + model.placa;

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

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

            data.eliminarBarco(model.placa);
            List <Barco> Barcos = data.obtenerBarcos();

            return(View("~/Views/Vehiculo/Barco.cshtml", Barcos));
        }
示例#4
0
        public PartialViewResult BarcoDD()
        {
            DAOBarco     data   = DAOBarco.getInstance();
            List <Barco> barcos = data.obtenerBarcos();

            return(PartialView("BarcoDropDown", barcos));
        }