示例#1
0
        public async Task <IActionResult> AgregarArticulo(VentaModel model)
        {
            if (HttpContext.Session.GetString("Logueo") != "Si")
            {
                HttpContext.Session.SetString("MensajeError", "Su sesión expiró.");
                return(RedirectToAction("Login", "Home"));
            }
            int idproducto = _context.Producto.Where(x => x.IdTipoFk == model.oProducto.IdTipoFk &&
                                                     x.IdMaterialFk == model.oProducto.IdMaterialFk &&
                                                     x.IdColorFk == model.oProducto.IdColorFk &&
                                                     x.IdMedidaFk == model.oProducto.IdMedidaFk).Select(x => x.IdProducto).FirstOrDefault();

            if (idproducto != 0)
            {
                model.oDetalleVenta.IdProductoFk = idproducto;
                _context.Add(model.oDetalleVenta);
                await _context.SaveChangesAsync();

                HttpContext.Session.SetString("MensajeError", "");
            }
            else
            {
                HttpContext.Session.SetString("MensajeError", "Producto no existente.");
            }
            return(RedirectToAction(nameof(CreateVenta), new { IdVenta = model.oDetalleVenta.IdVentaFk, editVenta = model.editVenta }));
        }
示例#2
0
        //public static List<VentaModel> obtenerClientes(VentaModel form)
        //{
        //    List<VentaModel> lista = null;
        //    try
        //    {
        //        DataTable dt = EjecutarSPConResultados(SP_VEN_OBTENER_CLIENTE, null);
        //        if (dt != null && dt.Rows.Count > 0)
        //        {
        //            lista = new List<VentaModel>();
        //            foreach (DataRow dr in dt.Rows)
        //            {
        //                VentaModel elemento = new VentaModel();
        //                elemento.Convertir(dr);
        //                lista.Add(elemento);
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {

        //    }

        //    return lista;
        //}

        public static List <VentaModel> obtenerClientes(VentaModel form)
        {
            List <VentaModel> data = new List <VentaModel>();

            try
            {
                List <SqlParameter> parametros = new List <SqlParameter>();
                parametros.Add(new SqlParameter("@nombrecompleto", form.Nombre));
                DataTable dt = EjecutarSPConResultados(SP_VEN_OBTENER_CLIENTE, parametros.ToArray());

                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        VentaModel elemento = new VentaModel();
                        elemento.Convertir(dr);
                        data.Add(elemento);
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(data);
        }
示例#3
0
        public ActionResult Create(VentaModel ventas)
        {
            var usrLog = (Usuario)Session["DatosUsuario"];
            var usuId  = usrLog.usuarioId;

            if (ModelState.IsValid)
            {
                var result = ventaService.InsertVenta(ventas, usuId);
                if (result == "ok")
                {
                    List <ModelVentaHome> VentaHome = new List <ModelVentaHome>();
                    TempData["Exito"] = "Venta creada con exito.";
                    TempData["idUsu"] = usuId.ToString();
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ViewData["Error"]               = result;
                    ViewData["desplegableTipo"]     = dDown.desplegableTipo(ventas.venta.tipo);
                    ViewData["provincias"]          = dDown.provincias(ventas.venta.provincia);
                    ViewData["desplegableAdjuntos"] = dDown.desplegableAdjuntos();
                    return(View("Index", ventas));
                    //return View(ventas);
                }
            }
            else
            {
                ViewData["desplegableTipo"]     = dDown.desplegableTipo(ventas.venta.tipo);
                ViewData["provincias"]          = dDown.provincias(ventas.venta.provincia);
                ViewData["desplegableAdjuntos"] = dDown.desplegableAdjuntos();
                return(View("Index", ventas));
            }
        }
        public void RegistrarVenta(VentaModel venta)
        {
            try
            {
                this.conexion = new SqlConnection(this.stringConexion);
                this.conexion.Open();
                this.comando             = new SqlCommand();
                this.comando.Connection  = this.conexion;
                this.comando.CommandText = "[Sp_Ins_Venta]";
                this.comando.CommandType = System.Data.CommandType.StoredProcedure;
                this.comando.Parameters.AddWithValue("@idCliente", venta.IdCliente);
                this.comando.Parameters.AddWithValue("@idMoto", venta.IdMoto);
                this.comando.Parameters.AddWithValue("@MotoType", venta.MotoType);
                this.comando.Parameters.AddWithValue("@payMethod", venta.PayMethod);
                this.comando.Parameters.AddWithValue("@totalPrice", venta.TotalPrice);

                this.comando.ExecuteNonQuery();


                this.conexion.Close();
                this.conexion.Dispose();
                this.comando.Dispose();
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }//FIN REGI VENTA
示例#5
0
        public ActionResult DetailVenta(int ventaId)
        {
            var           usrLog     = (Usuario)Session["DatosUsuario"];
            var           perfil     = usrLog.perfil.descripcion;
            VentaModel    ventaModel = new VentaModel();
            var           venta      = unitOfWork.VentaRepository.Find(x => x.ventaId == ventaId);
            string        lista      = "";
            var           c          = 0;
            List <string> adjuntosId = unitOfWork.AdjuntosRepository.Filter(x => x.ventaId == ventaId).Select(x => x.rutaAdjunto).ToList();

            foreach (var num in adjuntosId)
            {
                if (c > 0)
                {
                    lista = lista + ";" + "." + num.ToString();
                }
                else
                {
                    lista = "." + num.ToString();
                }
                c++;
            }

            ventaModel.strAdjId         = lista;
            ventaModel.venta            = venta;
            TempData["venta"]           = ventaModel;
            TempData["Perfil"]          = perfil;
            ViewData["desplegableTipo"] = dDown.desplegableTipo(ventaModel.venta.tipo);
            ViewData["provincias"]      = dDown.provincias(ventaModel.venta.provincia);
            return(View());
        }
示例#6
0
        public SubPedidoEditViewModel(FacadeProvider facadeProvider, VentaModel venta) : base(facadeProvider)
        {
            _venta = venta;
            Pedido = venta.SelectedChildren;

            AddSubPedidoComman = new AddSubPedidoCommand(this);
        }
        public void RemoveVenta(VentaModel venta)
        {
            if (Authenticator.Instance.IsAdming)
            {
                try
                {
                    var dlg = new ModernDialog
                    {
                        Title   = "Aviso",
                        Content = "Este elemento se eliminara permanente, desea continuar ?"
                    };
                    dlg.Buttons = new Button[] { dlg.OkButton, dlg.CancelButton };
                    dlg.ShowDialog();

                    if (dlg.MessageBoxResult == MessageBoxResult.OK)
                    {
                        FacadeProvider.VentaProvider().Remove(venta);
                        Ventas.Remove(venta);
                    }
                }
                catch (Exception e)
                {
                    ModernDialog.ShowMessage(e.Message, "Error en la Operación", MessageBoxButton.OK);
                }
            }
            else
            {
                ModernDialog.ShowMessage("No tiene permiso para realizar esta operación", "ERROR EN LA OPERACIÓN", MessageBoxButton.OK);
            }
        }
示例#8
0
        public void AddNewVenta()
        {
            Venta         = new VentaModel();
            Venta.Cliente = new ClienteModel();
            DeudaCliente  = null;
            Venta.Attach("Cliente", s => SetClientByDocument(s));

            InitPedidoToAddObjects();
        }
 public ObservableCollection <SubPedidoEntryModel> GetDailyReportPayment(VentaModel venta)
 {
     using (UnitOfWork)
     {
         var ventaSource     = Mapper.Map <VentaModel, Venta>(venta);
         var supedidosEntrys = UnitOfWork.SubPedidoEntryRepository.GetDailyReportPayment(ventaSource);
         return(Mapper.Map <IEnumerable <SubPedidoEntry>, ObservableCollection <SubPedidoEntryModel> >(
                    supedidosEntrys));
     }
 }
示例#10
0
 public Task <int> SaveItemAsync(VentaModel item)
 {
     if (item.ID != 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
        public SubPedidoEditPage(VentaModel venta)
        {
            InitializeComponent();
            _subPedidoEditViewModel = new SubPedidoEditViewModel(DependencyResolver.Instance.FacadeProvider, venta);
            DataContext             = _subPedidoEditViewModel;

            CommandModel addSubPedidoComman = _subPedidoEditViewModel.AddSubPedidoComman;

            ButtonAddSubPedio.Command          = addSubPedidoComman.Command;
            ButtonAddSubPedio.CommandParameter = this.DataContext;
            ButtonAddSubPedio.CommandBindings.Add(new CommandBinding(addSubPedidoComman.Command, addSubPedidoComman.OnExecute, addSubPedidoComman.OnCanExecute));
        }
示例#12
0
        public void ComprarArticulo(int usuarioId, int inventarioId)
        {
            VentaModel venta = new VentaModel
            {
                Id            = 0,
                Comprador_id  = usuarioId,
                Fecha         = DateTime.Now,
                Inventario_id = inventarioId,
                Status        = StatusVentas.ESPERANDO
            };

            _ventRet.Register(venta);
        }
示例#13
0
        public IActionResult Create()
        {
            if (HttpContext.Session.GetString("Logueo") != "Si")
            {
                HttpContext.Session.SetString("MensajeError", "Su sesión expiró.");
                return(RedirectToAction("Login", "Home"));
            }
            ViewData["TipoDocumento"] = new SelectList(_context.Documento, "IdDocumento", "Tipo");
            VentaModel model = new VentaModel();

            model.editVenta = 0;
            return(View(model));
        }
示例#14
0
 public async Task <IActionResult> AgregarProducto(VentaModel model)
 {
     if (HttpContext.Session.GetString("Logueo") != "Si")
     {
         HttpContext.Session.SetString("MensajeError", "Su sesión expiró.");
         return(RedirectToAction("Login", "Home"));
     }
     if (model.oVenta.IdVenta == 0)
     {
         model.oVenta.FechaVenta = DateTime.Now;
         _context.Add(model.oVenta);
         await _context.SaveChangesAsync();
     }
     return(RedirectToAction(nameof(CreateArticulo), new { IdVenta = model.oVenta.IdVenta, editVenta = model.editVenta }));
 }
示例#15
0
        public JsonResult buscaNombre(string Prefix)
        {
            //Note : you can bind same list from database
            List <VentaModel> ObjList = new List <VentaModel>();
            VentaModel        modelo  = new VentaModel();

            modelo.Nombre = Prefix;
            var Nombre = LogicaDatos.obtenerDatosNomina(modelo);

            //Searching records from list using LINQ query
            var CityList = (from N in ObjList
                            where N.Nombre.StartsWith(Prefix)
                            select new { N.Nombre });

            return(Json(Nombre, JsonRequestBehavior.AllowGet));
        }
示例#16
0
        public IActionResult CreateArticulo(int IdVenta, int editVenta)
        {
            if (HttpContext.Session.GetString("Logueo") != "Si")
            {
                HttpContext.Session.SetString("MensajeError", "Su sesión expiró.");
                return(RedirectToAction("Login", "Home"));
            }
            ViewData["Tipo"]     = new SelectList(_context.TipoProducto, "IdTipo", "Nombre");
            ViewData["Material"] = new SelectList(_context.MaterialProducto, "IdMaterial", "Nombre");
            ViewData["Color"]    = new SelectList(_context.ColorProducto, "IdColor", "Nombre");
            ViewData["Medida"]   = new SelectList(_context.MedidaProducto, "IdMedida", "CantidadCentimetros");
            VentaModel model = new VentaModel();

            model.editVenta = editVenta;
            model.oDetalleVenta.IdVentaFk = IdVenta;
            return(View(model));
        }
示例#17
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            bool sucess = false;

            sucess = ReciboValidacion();

            if (sucess)
            {
                Recibo     recibo = new Recibo();
                VentaModel venta  = new VentaModel();

                venta.recibo.Codigo         = Convert.ToString(txtCodigo.Text);
                venta.recibo.ClienteId      = new Guid(clienteId);
                venta.recibo.FechaAbono     = (DateTime)dpfechaabono.Value;
                venta.recibo.Concepto       = Convert.ToString(txtconcepto.Text);
                venta.recibo.MontoAbono     = Convert.ToDecimal(txtmontoabono.Text);
                venta.recibo.NuevoSaldo     = Convert.ToDecimal(txtnuevosaldo.Text);
                venta.recibo.ClientProducId = new Guid(ClientProducId);

                if (Editar == false)
                {
                    if (controller.InsertarRecibo(venta.recibo))
                    {
                        LimpiarTextBox();
                        ListRecibos();
                    }
                }
                if (Editar == true)
                {
                    venta.recibo.ReciboId = new Guid(reciboId);
                    try
                    {
                        if (controller.ActualizarRecibo(venta.recibo))
                        {
                            LimpiarTextBox();
                            ListRecibos();
                            Editar = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("No se pudo insertar los datos por: " + ex);
                    }
                }
            }
        }
示例#18
0
        public VentaDetailDialogPage(VentaModel venta)
        {
            InitializeComponent();

            _ventaDetailViewModel = new VentaDetailViewModel(DependencyResolver.Instance.FacadeProvider);
            _ventaDetailViewModel.InitializeViewContent();
            _ventaDetailViewModel.Venta = venta;

            VentaDetails ventaDetails = new VentaDetails(_ventaDetailViewModel);

            GdContainer.Children.Add(ventaDetails);

            OkButton.Content = "Aceptar";

            // define the dialog buttons
            this.Buttons = new Button[] { this.OkButton };
        }
示例#19
0
        public DailyPaymentPrintPage(VentaModel venta, List <SubPedidoEntryModel> subPedidoEntrys)
        {
            InitializeComponent();

            VentaNumberConverter ventaNumberConverter = new VentaNumberConverter();
            var ventaNumber = ventaNumberConverter.Convert(venta.VentaId, null, null, null);



            var ventaDataSource = new ReportDataSource("VentaDataSet",
                                                       new List <VentaDataSetModel>()
            {
                new VentaDataSetModel
                {
                    Numero           = ventaNumber.ToString(),
                    Fecha            = venta.Fecha.ToShortDateString(),
                    ClienteCedula    = venta.Cliente.NumeroDocumento,
                    ClienteNombre    = venta.Cliente.Nombre,
                    ClienteDireccion = venta.Cliente.Direccion,
                    ClienteTelefono  = venta.Cliente.Telefono,
                    Trabajador       = venta.Trabajador.Nombre
                }
            });


            List <DailyPaymentDataSetModel> dailyPaymentDataSet = new List <DailyPaymentDataSetModel>();

            foreach (var subPedidoEntryModel in subPedidoEntrys)
            {
                dailyPaymentDataSet.Add(new DailyPaymentDataSetModel
                {
                    Identificador = subPedidoEntryModel.SubPedido.Identificador,
                    Abono         = subPedidoEntryModel.Abono,
                    Deuda         = subPedidoEntryModel.SubPedido.Deuda
                });
            }

            var dailyPaymentDataSource = new ReportDataSource("DailyPaymentsDataSet", dailyPaymentDataSet);

            ReportViewer.ZoomMode = ZoomMode.PageWidth;
            ReportViewer.LocalReport.ReportPath = Directory.GetCurrentDirectory() + @"\Reports\DailyPaymentReport.rdlc";
            ReportViewer.LocalReport.DataSources.Add(ventaDataSource);
            ReportViewer.LocalReport.DataSources.Add(dailyPaymentDataSource);
            ReportViewer.RefreshReport();
        }
        public SubPedidoDialogEditPage(VentaModel venta)
        {
            InitializeComponent();

            // define the dialog buttons
            OkButton.Content = "Aceptar";
            this.Buttons     = new Button[] { this.OkButton };

            InitializeComponent();
            _subPedidoEditViewModel = new SubPedidoEditViewModel(DependencyResolver.Instance.FacadeProvider, venta);
            _subPedidoEditViewModel.InitializeViewContent();
            DataContext = _subPedidoEditViewModel;

            CommandModel addSubPedidoComman = _subPedidoEditViewModel.AddSubPedidoComman;

            ButtonAddSubPedio.Command          = addSubPedidoComman.Command;
            ButtonAddSubPedio.CommandParameter = this.DataContext;
            ButtonAddSubPedio.CommandBindings.Add(new CommandBinding(addSubPedidoComman.Command, addSubPedidoComman.OnExecute, addSubPedidoComman.OnCanExecute));
        }
示例#21
0
 public string InsertVenta(VentaModel ventas, int usuId)
 {
     try
     {
         var existe = unitOfWork.VentaRepository.Find(x => x.nombreVenta == ventas.venta.nombreVenta && x.usuarioId == ventas.venta.usuarioId);
         if (existe == null)
         {
             unitOfWork.VentaRepository.Create(ventas.venta);
             ventas.venta.usuarioId = usuId;
             foreach (string tipo in ventas.desplegableTipo)
             {
                 ventas.venta.tipo = tipo;
             }
             foreach (string pro in ventas.provincias)
             {
                 ventas.venta.provincia = pro;
             }
             unitOfWork.VentaRepository.Save();
             if (!String.IsNullOrEmpty(ventas.strAdjId))
             {
                 char[] splitchar = { ';' };
                 var    idAdj     = ventas.strAdjId.Split(splitchar);
                 for (var count = 0; count <= idAdj.Length - 1; count++)
                 {
                     int      idInt = Convert.ToInt32(idAdj[count]);
                     Adjuntos Adj   = unitOfWork.AdjuntosRepository.Find(x => x.AdjuntosId == idInt);
                     Adj.ventaId = ventas.venta.ventaId;
                     unitOfWork.AdjuntosRepository.Update(Adj);
                     unitOfWork.AdjuntosRepository.Save();
                 }
             }
             return("ok");
         }
         else
         {
             return("Ya existe una Venta Creada con ese nombre");
         }
     }
     catch (Exception e)
     {
         return("Error no Controlado: " + e.Message + ". Comuniquese con el administrador.");
     }
 }
示例#22
0
        public VentasEditViewModel()
        {
            Venta           = new VentaModel();
            GuardarCommand  = new Command(guardar);
            CancelarCommand = new Command(cancelar);


            cargarproductos();
            cargarcategorias();

            var precio = PrecioTotal;

            ProcesarTexto   = $"Productos agregados: {StepperValue}  - $ {Math.Round(PrecioTotal, 2)}";
            StepperValueMax = 1;

            //Lista = new List<CategoriaModel>()
            //{
            //    new CategoriaModel { ID = 1, Nombre_Categoria = "Reparacion" },
            //};
        }
示例#23
0
        public ActionResult Index()
        {
            var usrLog         = (Usuario)Session["DatosUsuario"];
            var perfilId       = usrLog.perfilId;
            var funcionalidad  = "Listado";
            var Proceso        = "PUBLICAR";
            var mensajePermiso = PermisosDeUsuarios(perfilId, funcionalidad, Proceso);

            if (mensajePermiso != "ok")
            {
                return(PartialView("NoAutorizado", "Shared"));
            }
            LimpiarAdjObs();
            VentaModel modelo = new VentaModel();

            ViewData["desplegableAdjuntos"] = dDown.desplegableAdjuntos();
            ViewData["desplegableTipo"]     = dDown.desplegableTipo();
            ViewData["provincias"]          = dDown.provincias();
            return(View());
        }
示例#24
0
        public IActionResult CreateVenta(int IdVenta, int editVenta)
        {
            if (HttpContext.Session.GetString("Logueo") != "Si")
            {
                HttpContext.Session.SetString("MensajeError", "Su sesión expiró.");
                return(RedirectToAction("Login", "Home"));
            }
            ViewData["MensajeError"]  = HttpContext.Session.GetString("MensajeError");
            ViewData["TipoDocumento"] = new SelectList(_context.Documento, "IdDocumento", "Tipo");
            VentaModel model = new VentaModel();

            model.editVenta     = editVenta;
            model.oVenta        = _context.Venta.Find(IdVenta);
            model.listArticulos = (from a in _context.Venta
                                   join b in _context.DetalleVenta on a.IdVenta equals b.IdVentaFk
                                   join c in _context.Producto on b.IdProductoFk equals c.IdProducto
                                   join d in _context.TipoProducto on c.IdTipoFk equals d.IdTipo
                                   join e in _context.MaterialProducto on c.IdMaterialFk equals e.IdMaterial
                                   join f in _context.ColorProducto on c.IdColorFk equals f.IdColor
                                   join g in _context.MedidaProducto on c.IdMedidaFk equals g.IdMedida
                                   where a.IdVenta == IdVenta
                                   select new Articulo
            {
                IDDetalle = b.IdDetalle,
                Tipo = d.Nombre,
                Material = e.Nombre,
                Color = f.Nombre,
                Medida = g.CantidadCentimetros,
                Cantidad = b.Cantidad,
                ValorUnidad = b.ValorUnitario
            }).ToList();

            foreach (var item in model.listArticulos)
            {
                decimal valor  = item.ValorUnidad ?? 0;
                decimal valor2 = (decimal)item.Cantidad;
                item.ValorTotal   = valor * valor2;
                model.ValorTotal += item.ValorTotal;
            }
            return(View("Create", model));
        }
示例#25
0
        private async void SaveVenta()
        {
            var venta = FacadeProvider.VentaProvider().Add(Venta);

            InitPedidoToAddObjects();

            Venta         = new VentaModel();
            Venta.Cliente = new ClienteModel();
            DeudaCliente  = null;
            Venta.Attach("Cliente", s => SetClientByDocument(s));

            var ventaPrintPage = await Task.Factory.StartNew(() =>
            {
                return(new VentaPrintPage());
            }, CancellationToken.None
                                                             , TaskCreationOptions.None
                                                             , TaskScheduler.FromCurrentSynchronizationContext());

            ventaPrintPage.VentaModels = venta;
            ventaPrintPage.ShowDialog();
        }
示例#26
0
        public ActionResult Crear(VentaModel model)
        {
            Guid id = Guid.NewGuid();

            try
            {
                Venta Venta = new Venta()
                {
                    VentaId      = 106,
                    VideoJuegoId = 106,
                    ClienteId    = 106,
                    Fecha        = model.Fecha.Value,
                };
                VentaBrl.Insertar(Venta);
                return(RedirectToAction(""));
            }
            catch
            {
                return(View());
            }
        }
示例#27
0
        public ActionResult DeleteVenta(int ventaId)
        {
            VentaModel ventaModel = new VentaModel();
            var        venta      = unitOfWork.VentaRepository.Find(x => x.ventaId == ventaId);
            var        result     = ventaService.DeleteVenta(ventaId);

            ventaModel.venta = venta;

            if (result == "ok")
            {
                TempData["Exito"] = "Venta Eliminada con Exito.";
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                TempData["Error"]           = result;
                ViewData["desplegableTipo"] = dDown.desplegableTipo(ventaModel.venta.tipo);
                ViewData["provincias"]      = dDown.provincias(ventaModel.venta.provincia);
                return(RedirectToAction("Index", "Home"));
            }
        }
示例#28
0
        public List <VentaModel> GetAllVenta()
        {
            Database  db        = DatabaseFactory.CreateDatabase(Config);
            DbCommand dbCommand = db.GetStoredProcCommand("spGetVentaAll");

            List <VentaModel> list = new List <VentaModel>();

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    VentaModel obj = new VentaModel();

                    if (dataReader["IdVenta"] != DBNull.Value)
                    {
                        obj.IdVenta = (int)dataReader["IdVenta"];
                    }
                    if (dataReader["IdProducto"] != DBNull.Value)
                    {
                        obj.IdProducto = (int)dataReader["IdProducto"];
                    }
                    if (dataReader["IdCliente"] != DBNull.Value)
                    {
                        obj.IdCliente = (int)dataReader["IdCliente"];
                    }
                    if (dataReader["Cantidad"] != DBNull.Value)
                    {
                        obj.Cantidad = (float)dataReader["Cantidad"];
                    }

                    list.Add(obj);
                }
            }

            return(list);
        }
示例#29
0
 public static List <VentaModel> obtenerDatosNomina(VentaModel form)
 {
     return(DBCatalogos.obtenerClientes(form));
 }
        // GET: Venta/Create
        public ActionResult Create(string id)
        {
            ViewBag.PuntoDeVentaList = (from y in _dbContext.PuntoDeVenta
                                        select new SelectListItem()
            {
                Text = y.Nombre,
                Value = y.PuntoDeVentaId.ToString()
            }).ToList();

            ViewBag.MetodoDePagoList = (from y in _dbContext.MetodoPago
                                        select new SelectListItem()
            {
                Text = y.Nombre,
                Value = y.MetodoPagoId.ToString()
            }).ToList();

            ViewBag.ListaTipoFactura = (from y in new FastServiceEntities().TipoFactura
                                        select new SelectListItem()
            {
                Text = y.Nombre,
                Value = y.TipoFacturaId.ToString()
            }).ToList();

            ViewBag.NroCuotasList = (new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Selected = true, Text = "1", Value = "1"
                },
                new SelectListItem()
                {
                    Selected = false, Text = "2", Value = "2"
                },
                new SelectListItem()
                {
                    Selected = false, Text = "3", Value = "3"
                },
                new SelectListItem()
                {
                    Selected = false, Text = "4", Value = "4"
                },
                new SelectListItem()
                {
                    Selected = false, Text = "5", Value = "5"
                },
                new SelectListItem()
                {
                    Selected = false, Text = "6", Value = "6"
                }
            }).ToList();

            var model = new VentaModel();

            model.Producto = (from x in _dbContext.Producto
                              where x.id.ToString() == id
                              select new ProductoModel()
            {
                Nombre = x.nombre,
                Descripcion = x.descripcion,
                Costo = x.costo,
                Categoria = x.categoria,
                Categoria2 = x.categoria2,
                Categoria3 = x.categoria3,
                Utilidad = x.utilidad
            }).FirstOrDefault();

            return(PartialView(model));
        }