Beispiel #1
0
        public ActionResult Create(IFormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                AlquilerData alquilerData = new AlquilerData();

                System.Diagnostics.Debug.WriteLine("COMPLETO 0.5: " + Request.Query["IdAlquiler"]);
                System.Diagnostics.Debug.WriteLine("COMPLETOOOOO" + Request.Form["IdAlquiler"].ToString());
                Alquiler alquiler = alquilerData.obtenerAlquiler(Convert.ToInt32(Request.Form["IdAlquiler"]));
                System.Diagnostics.Debug.WriteLine("IDDDDDDDDDDDDD: " + Convert.ToInt32(Request.Form["IdAlquiler"]));
                System.Diagnostics.Debug.WriteLine("COMPLETO 1");
                Pagos pago = new Pagos {
                    NroPago  = new PagosData().obtenerNumerosDePagos(Convert.ToInt32(Request.Form["IdAlquiler"])) + 1,
                    Fecha    = Convert.ToDateTime(Request.Form["Fecha"]),
                    Importe  = Convert.ToDouble(Request.Form["Importe"]),
                    Alquiler = alquiler,
                };
                System.Diagnostics.Debug.WriteLine("COMPLETO 2");

                PagosData pagosData = new PagosData();
                pagosData.crear(pago);
                System.Diagnostics.Debug.WriteLine("COMPLETO 3");

                return(RedirectToAction(nameof(Index), "Pagos", new { IdAlquiler = Convert.ToInt32(Request.Form["IdAlquiler"]) }));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("EXCEPCION :" + e.Message);
                return(View());
            }
        }
Beispiel #2
0
        public ActionResult Renovar()
        {
            int          idAlquiler   = Convert.ToInt32(Request.Form["IdAlquiler"]);
            double       Precio       = Convert.ToDouble(Request.Form["Precio"]);
            DateTime     FechaInicio  = Convert.ToDateTime(Request.Form["FechaInicio"]);
            DateTime     FechaFin     = Convert.ToDateTime(Request.Form["FechaFin"]);
            AlquilerData alquilerData = new AlquilerData();
            Alquiler     alquiler     = alquilerData.obtenerAlquiler(idAlquiler);

            //alquiler.
            alquilerData.renovarAlquiler(idAlquiler, FechaInicio, FechaFin, Precio);
            return(RedirectToAction(nameof(Index)));
        }