public ActionResult Create(int idLaboratorio, int idLaboratorista, int idAlumno, string fechaLimite, List <int> idEjemplares)
        {
            Laboratorio l = new Laboratorio();

            Laboratorista e = new Laboratorista();

            Alumno a = new Alumno();

            Prestamo p = new Prestamo();

            l.IdLaboratorio   = idLaboratorio;
            e.idLaboratorista = idLaboratorista;
            a.idAlumno        = idAlumno;

            p.Laboratorio   = l;
            p.Laboratorista = e;
            p.Alumno        = a;
            p.FechaLimite   = fechaLimite;



            string[] respuesta = DPrestamo.realizarPrestamo(p, idEjemplares);

            int validacion = Convert.ToInt32(respuesta[0]);

            if (validacion == 1)
            {
                return(Json(new { result = "Redirect", url = Url.Action("Index", "Prestamo"), clavePrestamo = respuesta[1] }));
            }



            return(Json("'validacion':'" + respuesta[0] + "'", JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public static DataTable BuscarPrestamoMatricula(string matricula)
        {
            DPrestamo Obj = new DPrestamo();

            Obj.Matricula = matricula;

            return(Obj.BuscarPrestamoMatricula(Obj));
        }
Beispiel #3
0
        public static string Eliminar(string matricula)
        {
            DPrestamo Obj = new DPrestamo();

            Obj.Matricula = matricula;

            return(Obj.Eliminar(Obj));
        }
        public ActionResult Index(string clavePrestamo)
        {
            if (clavePrestamo != null && clavePrestamo != "")
            {
                ViewBag.clavePrestamo = clavePrestamo;
            }

            //Listamos todas las carreras en una tabla
            DataTable PrestamosList = DPrestamo.ListarPrestamos();

            return(View(PrestamosList));
        }
        // GET: Prestamo/Create
        public ActionResult Create()
        {
            List <Alumno>        alumnos        = DPrestamo.ListarAlumnos();
            List <Laboratorista> laboratoristas = DPrestamo.ListarLaboratoristas();
            List <Ejemplar>      ejemplares     = DPrestamo.ListarMaterialesEjemplares();

            ViewBag.Alumnos        = alumnos;
            ViewBag.Laboratoristas = laboratoristas;
            ViewBag.Ejemplares     = ejemplares;


            return(View(new Prestamo()));
        }
Beispiel #6
0
        public static string Insertar(string matricula, string tipoprestamo, string isbn, string isbn2, string isbn3,
                                      DateTime fecha_prestamo, DateTime primer_renovacion, DateTime segunda_renovacion,
                                      string observaciones, string estatus)
        {
            DPrestamo Obj = new DPrestamo();

            Obj.Matricula         = matricula;
            Obj.TipoPrestamo      = tipoprestamo;
            Obj.ISBN              = isbn;
            Obj.ISBN2             = isbn2;
            Obj.ISBN3             = isbn3;
            Obj.FechaPrestamo     = fecha_prestamo;
            Obj.PrimerRenovacion  = primer_renovacion;
            Obj.SegundaRenovacion = segunda_renovacion;
            Obj.Observaciones     = observaciones;
            Obj.Estatus           = estatus;

            return(Obj.Insertar(Obj));
        }