Exemplo n.º 1
0
        public ActionResult CalcularVenta(VentaViewModels datos)
        {
            var venta = new VentaViewModels();

            venta.Cliente  = cliente;
            venta.Empleado = empleado;
            venta.Lote     = lote;

            datos.Cuota.cantidad = lote.precio_lote;
            Lotificadora lotificadora = new Lotificadora(new DBLotificadora());
            var          loti         = lotificadora.SelectForId(lote.lotificadora_id);

            datos.Cuota.interes = loti.tasa_interes;

            CuotaVenta cuota = new CuotaVenta();

            if (datos.Cuota.descuento != 0)
            {
                venta.Cuota = cuota.CalcularDescuento(datos.Cuota);
                cuota_venta = venta.Cuota;
            }
            else
            {
                venta.Cuota = cuota.CalcularSinDescuento(datos.Cuota);
                cuota_venta = venta.Cuota;
            }

            return(View(venta));
        }
Exemplo n.º 2
0
        // GET: Lotificadora
        public ActionResult Index()
        {
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            var            listalotifi    = lotifi.SelectAll();

            return(View(listalotifi));
        }
Exemplo n.º 3
0
        public ActionResult Edit(LotificadoraViewModels datos)
        {
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);

            lotifi.Update(datos);
            return(RedirectToAction("Index", "Lotificadora"));
        }
Exemplo n.º 4
0
        public ActionResult Save()
        {
            Lotificadora lt    = new Lotificadora(new DBLotificadora());
            var          promo = new PromocionViewModels();

            promo.Lotificadoras = lt.SelectAll();
            return(View(promo));
        }
Exemplo n.º 5
0
        public ActionResult Delete(int id)
        {
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);

            lotifi.Delete(id);
            return(RedirectToAction("Index", "Lotificadora"));
        }
Exemplo n.º 6
0
        public ActionResult Edit(int id)
        {
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            var            lotifica       = lotifi.SelectForId(id);

            return(View(lotifica));
        }
Exemplo n.º 7
0
        public ActionResult Create(LotificadoraViewModels datos)
        {
            ViewBag.Title = "Ingresar Lotificadora";

            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);

            lotifi.Save(datos);

            return(RedirectToAction("Index", "Lotificadora"));
        }
Exemplo n.º 8
0
        public ActionResult Edit(LotificadoraViewModels model)
        {
            if (ModelState.IsValid)
            {
                Lotificadora = dbCtx.Lotificadora.FirstOrDefault(a => a.Id == model.Id);
                Lotificadora.NombreLotificadora = model.NombreLotificadora;
                Lotificadora.Direccion          = model.Direccion;
                dbCtx.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 9
0
        public ActionResult Edit(int id)
        {
            ViewBag.Title = "Editar Lotificadora";

            LotificadoraViewModels lotificadora = new LotificadoraViewModels();

            Lotificadora    = dbCtx.Lotificadora.FirstOrDefault(a => a.Id == id);
            lotificadora.Id = Lotificadora.Id;
            lotificadora.NombreLotificadora = Lotificadora.NombreLotificadora;
            lotificadora.Direccion          = Lotificadora.Direccion;

            return(View(lotificadora));
        }
Exemplo n.º 10
0
        // GET: Promocion
        public ActionResult Index()
        {
            var       promociones = new PromoViewModels();
            Promocion promo       = new Promocion();

            promo._SelectAll        = new DBPromocion();
            promociones.Promociones = promo.GetAll();

            Lotificadora lt = new Lotificadora(new DBLotificadora());

            promociones.Lotificadoras = lt.SelectAll();
            return(View(promociones));
        }
Exemplo n.º 11
0
        private void FinanVenta(int ventaId)
        {
            DBFinanVenta         dbFinanVenta = new DBFinanVenta();
            FinanVentaViewModels finanVenta   = new FinanVentaViewModels();
            Lotificadora         lotificadora = new Lotificadora(new DBLotificadora());
            var loti = lotificadora.SelectForId(lote.lotificadora_id);

            finanVenta.Tiempo      = cuota_venta.tiempo;
            finanVenta.Cuota       = cuota_venta.cuota;
            finanVenta.TasaInteres = loti.tasa_interes;
            finanVenta.Mora        = loti.tasa_mora;
            finanVenta.VentaId     = ventaId;
            dbFinanVenta.Save(finanVenta);
        }
Exemplo n.º 12
0
        public ActionResult Edit(int id)
        {
            var       model = new PromocionViewModels();
            Promocion promo = new Promocion();

            promo._SelectForId = new DBPromocion();
            model = promo.SelectForId(id);
            Lotificadora lt = new Lotificadora(new DBLotificadora());

            model.Lotificadoras = lt.SelectAll();

            //var promocion = promo.SelectForId(id);
            return(View(model));
        }
Exemplo n.º 13
0
        public ActionResult Create()
        {
            ViewBag.Title = "Ingresar Viaticos";

            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);

            DBEmpleados dbempleados = new DBEmpleados();
            Empleados   empleado    = new Empleados(dbempleados);

            ViaticosViewModels via = new ViaticosViewModels();

            via.lotificadoras = lotifi.SelectAll();
            via.empleados     = empleado.SelectAll();

            return(View(via));
        }
Exemplo n.º 14
0
        public ActionResult Edit(int id)
        {
            DBViaticos     dbviati        = new DBViaticos();
            Viaticos       viati          = new Viaticos(dbviati);
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            DBEmpleados    dbempleados    = new DBEmpleados();
            Empleados      empleado       = new Empleados(dbempleados);

            ViaticosViewModels viati2 = new ViaticosViewModels();

            viati2 = viati.SelectForId(id);
            viati2.lotificadoras = lotifi.SelectAll();
            viati2.empleados     = empleado.SelectAll();

            return(View(viati2));
        }
Exemplo n.º 15
0
        public ActionResult Edit(int id)
        {
            DBGastos       dbgastos       = new DBGastos();
            Gastos         gasto          = new Gastos(dbgastos);
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            DBEmpleados    dbempleados    = new DBEmpleados();
            Empleados      empleado       = new Empleados(dbempleados);

            GastosViewModels gasto2 = new GastosViewModels();

            gasto2 = gasto.SelectForId(id);
            gasto2.lotificadoras = lotifi.SelectAll();
            gasto2.empleados     = empleado.SelectAll();

            return(View(gasto2));
        }
Exemplo n.º 16
0
        public ActionResult Create()
        {
            ViewBag.Title = "Ingresar Gastos";

            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);

            DBEmpleados dbempleados = new DBEmpleados();
            Empleados   empleado    = new Empleados(dbempleados);

            GastosViewModels gast = new GastosViewModels();

            gast.lotificadoras = lotifi.SelectAll();
            gast.empleados     = empleado.SelectAll();

            return(View(gast));
        }
Exemplo n.º 17
0
        public ActionResult Create()
        {
            ViewBag.Title = "Ingresar Lote";
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            DBManzana      dbmanzana      = new DBManzana();
            Manzana        manzana        = new Manzana(dbmanzana);
            DBEstadoLote   dbestado       = new DBEstadoLote();
            EstadoLote     estado         = new EstadoLote(dbestado);

            LoteIngresoViewModels lote = new LoteIngresoViewModels();

            lote.lotificadoras = lotifi.SelectAll();
            lote.manzanas      = manzana.SelectAll();
            lote.estados       = estado.SelectAll();

            return(View(lote));
        }
Exemplo n.º 18
0
        public ActionResult Edit(int id)
        {
            DBLote         dblote         = new DBLote();
            Lote           lote           = new Lote(dblote);
            DBLotificadora dblotificadora = new DBLotificadora();
            Lotificadora   lotifi         = new Lotificadora(dblotificadora);
            DBManzana      dbmanzana      = new DBManzana();
            Manzana        manzana        = new Manzana(dbmanzana);
            DBEstadoLote   dbestado       = new DBEstadoLote();
            EstadoLote     estado         = new EstadoLote(dbestado);

            LoteIngresoViewModels lote2 = new LoteIngresoViewModels();

            lote2 = lote.SelectForId(id);
            lote2.lotificadoras = lotifi.SelectAll();
            lote2.manzanas      = manzana.SelectAll();
            lote2.estados       = estado.SelectAll();
            return(View(lote2));
        }
Exemplo n.º 19
0
        //private object lotificadora;
        //private object lotificadoras;

        public LotificadoraController()
        {
            dbCtx        = new ApplicationDbContext();
            Lotificadora = new Lotificadora();
        }