Пример #1
0
 public PedidoController(IProductoBLL ProductoBLL, ICarroBLL CarroBLL, IUsuarioBLL UsuarioBLL, IPedidoBLL PedidoBLL)
 {
     this._productoBLL = ProductoBLL;
     this._carroBLL    = CarroBLL;
     this._usuarioBLL  = UsuarioBLL;
     this._pedidoBLL   = PedidoBLL;
 }
Пример #2
0
        private string Mensaje(string total)
        {
            productobll = new ProductoBLLImp();
            Producto pr;

            pr = productobll.BuscarPorId(productos[0, 0]);
            string msj = "<h3>Producto:" + pr.nombre + "</h3><br>" +
                         "<h3>Cantidad:" + productos[0, 1] + "</h3><br>" +
                         "<h3>Precio:" + pr.precioVenta + "</h3><br>***********************************************************";

            for (int i = 1; i < productos.Length; i++)
            {
                if (productos[i, 0] == null)
                {
                    msj += "<br><h2>Total:" + total + "</h2>";
                    return(msj);
                }
                else
                {
                    pr   = productobll.BuscarPorId(productos[i, 0]);
                    msj += "<h3>Producto:" + pr.nombre + "</h3><br>" +
                           "<h3>Cantidad:" + productos[i, 1] + "</h3><br>" +
                           "<h3>Precio:" + pr.precioVenta + "</h3><br>***********************************************************";
                }
            }
            msj += "<br><h2>Total:" + total + "</h2>";
            return(msj);
        }
Пример #3
0
        public ActionResult Tabla2(string id, string can)
        {
            productobll = new ProductoBLLImp();
            string   htmlCode = string.Empty;
            Producto PR       = productobll.BuscarPorId(id);

            productos[cantidad, 0] = id;
            productos[cantidad, 1] = can;
            int cann;

            if (can.Equals(string.Empty))
            {
                cann = 1;
            }
            else
            {
                cann = int.Parse(can);
            }
            int can2 = int.Parse(PR.precioVenta);

            can2 = can2 * cann;
            productos[cantidad, 2] = can2.ToString();
            cantidad++;
            htmlCode = "<tr id=\"" + PR.idProducto + "\">" +
                       "<td>" + PR.idProducto + "</td>" +
                       "<td>" + PR.nombre + "</td>" +
                       "<td>" + cann + "</td>" +
                       "<td>" + can2 + "</td>" +
                       "<td class=\"text-right\">" +
                       "<a href = \"#\" class=\"btn btn-simple btn-danger btn-icon \" onclick=\"eliminar('" + PR.idProducto + "')\"><i class=\"fa fa-times\" ></i></a>" +
                       "</td>" +
                       "</tr>";
            return(Json(new { result = htmlCode, total = can2 }, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult Eliminar(string idpersona)
        {
            productoBLL = new ProductoBLLImp();
            bool a = productoBLL.Eliminar(idpersona);

            return(Json(new { result = a }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public ActionResult Editar(string idpersona)
        {
            productoBLL = new ProductoBLLImp();
            Producto per = productoBLL.BuscarPorId(idpersona);

            return(Json(new
            {
                nombre = per.nombre,
                cantidad = per.cantidad,
                precioCompra = per.precioCompra,
                precioVenta = per.precioVenta,
                idProducto = per.idProducto
            }, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public ActionResult Combo()
        {
            productobll = new ProductoBLLImp();
            List <Producto> productos;

            productos = productobll.BuscarTodos(Session["empresa"].ToString());
            String htmlCode = "<select id = \"rol\" class=\"form-control\" > ";

            foreach (Producto pr in productos)
            {
                htmlCode += "<option value = \"" + pr.idProducto + "\"  > " + pr.nombre + " </option >";
            }
            htmlCode += "</select>";
            return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet));
        }
Пример #7
0
        public ActionResult GuardarEdicion(string nombre, int cantidad, string precioCompra, string precioVenta, string idpro)
        {
            productoBLL = new ProductoBLLImp();
            Producto per = new Producto
            {
                nombre          = nombre,
                cantidad        = cantidad,
                precioCompra    = precioCompra,
                precioVenta     = precioVenta,
                idNombreEmpresa = (string)Session["empresa"],
                idProducto      = idpro
            };

            productoBLL.Modificar(per);
            return(Json(new { result = string.Empty }, JsonRequestBehavior.AllowGet));
        }
Пример #8
0
        public bool Crear(string idCompra, string[,] productos)
        {
            productoBLL = new ProductoBLLImp();
            Producto pr;

            try
            {
                using (unitOfWork = new UnitOfWork(new GymContext()))
                {
                    using (GymContext Context = new GymContext())
                    {
                        for (int i = 0; i < productos.Length; i++)
                        {
                            if (productos[i, 0] == null)
                            {
                                return(true);
                            }
                            else
                            {
                                string         id = ConsecutivoModifica("CRM");
                                CompraProducto cp = new CompraProducto()
                                {
                                    idCompraProducto = id,
                                    idCompra         = idCompra,
                                    idProducto       = productos[i, 0],
                                    cantidad         = int.Parse(productos[i, 1]),
                                    total            = productos[i, 2]
                                };
                                pr          = productoBLL.BuscarPorId(productos[i, 0]);
                                pr.cantidad = pr.cantidad - int.Parse(productos[i, 1]);
                                unitOfWork.compraProductoDAL.Add(cp);
                                productoBLL.Modificar(pr);
                                unitOfWork.Complete();
                            }
                        }
                    }
                }
                return(true);
            }
            catch (Exception a)
            {
                string e = a.Message;
                return(false);
            }
        }
Пример #9
0
        public ActionResult Tabla2(string id)
        {
            productoCierreBLL = new CierreProductoBLLImp();
            productoBLL       = new ProductoBLLImp();
            List <CierreProducto> resultado = productoCierreBLL.BuscarCierre(id);
            String htmlCode = String.Empty;

            foreach (CierreProducto per in resultado)
            {
                Producto pro = productoBLL.BuscarPorId(per.idProducto);
                htmlCode += "<tr>" +
                            "<td>" + per.idCierreProducto + "</td>" +
                            "<td>" + per.idProducto + "</td>" +
                            "<td>" + pro.nombre + "</td>" +
                            "<td>" + per.cantidadCierre + "</td>" +
                            "<tr>";
            }
            return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet));
        }
Пример #10
0
        public ActionResult Segunda(string id)
        {
            compraProductoBLL = new CompraProductoBLLImp();
            productobll       = new ProductoBLLImp();
            List <CompraProducto> resultado = compraProductoBLL.BuscarCierre(id);
            String htmlCode = String.Empty;

            foreach (CompraProducto per in resultado)
            {
                Producto pro = productobll.BuscarPorId(per.idProducto);
                htmlCode += "<tr>" +
                            "<td>" + pro.idProducto + "</td>" +
                            "<td>" + pro.nombre + "</td>" +
                            "<td>" + per.cantidad + "</td>" +
                            "<td>" + pro.precioVenta + "</td>" +
                            "<tr>";
            }
            return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
 public DetalleVentaUI(
     IVentaBLL ventaBLL,
     IDetalleVentaBLL detalleVentaBLL,
     IProductoBLL productoBLL,
     IProductos productos,
     IClienteBLL clienteBLL,
     IClientes cliente,
     IFormControl formControl,
     ITraductor traductor)
 {
     this.ventaBLL        = ventaBLL;
     this.detalleVentaBLL = detalleVentaBLL;
     this.productoBLL     = productoBLL;
     this.productos       = productos;
     this.cliente         = cliente;
     this.clienteBLL      = clienteBLL;
     this.formControl     = formControl;
     this.traductor       = traductor;
     InitializeComponent();
     dgDetalleVta.AutoGenerateColumns = false;
 }
Пример #12
0
        public ActionResult Ingreso(string nombre, int cantidad, string precioCompra, string precioVenta)
        {
            productoBLL = new ProductoBLLImp();
            string idproString;

            idproString = fb.ConsecutivoModifica("Pro");


            Producto per = new Producto
            {
                nombre          = nombre,
                cantidad        = cantidad,
                precioCompra    = precioCompra,
                precioVenta     = precioVenta,
                idNombreEmpresa = (string)Session["empresa"],
                idProducto      = idproString
            };
            bool a = productoBLL.Agregar(per);

            return(Json(new { bol = a }, JsonRequestBehavior.AllowGet));
        }
Пример #13
0
        public ActionResult Tabla()
        {
            productoBLL = new ProductoBLLImp();
            List <Producto> resultado = productoBLL.BuscarTodos(Session["empresa"].ToString());
            String          htmlCode  = String.Empty;

            foreach (Producto per in resultado)
            {
                htmlCode += "<tr>" +
                            "<td>" + per.idProducto + "</td>" +
                            "<td>" + per.nombre + "</td>" +
                            "<td>" + per.cantidad + "</td>" +
                            "<td>" + per.precioCompra + "</td>" +
                            "<td>" + per.precioVenta + "</td>" +
                            "<td class=\"text - right\" > " +
                            "<a href = \"#\" class=\"btn btn-simple btn-info btn-icon \" data-toggle=\"modal\" data-target=\"#myModal2\" ><i class=\"fa fa-user\"></i></a>" +
                            "<a href = \"#\" class=\"btn btn-simple btn-warning btn-icon \" data-toggle=\"modal\" data-target=\"#myModal1\" onclick=\"EditarAjax('" + per.idProducto + "')\"><i class=\"fa fa-edit\"></i></a>" +
                            "<a href = \"#\" onclick=\"warninMessage(); EliminarCargar('" + per.idProducto + "')\" class=\"btn btn-simple btn-danger btn-icon\" ><i class=\"fa fa-times\" ></i></a>" +
                            "</td>" +
                            "<tr>";
            }
            return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet));
        }
Пример #14
0
 public Productos(IProductoBLL productoBLL, IBloqueoProductos bloqueoProductos)
 {
     this.productoBLL      = productoBLL;
     this.bloqueoProductos = bloqueoProductos;
     InitializeComponent();
 }
Пример #15
0
 public ProductoController()
 {
     productoBLL  = new ProductoBLLImpl();
     proveedorBLL = new ProveedorBLLImpl();
 }
Пример #16
0
 public CarroBLL(IRepositoryCarro repositoryCarro, IProductoBLL productoBLL)
 {
     this._repositoryCarro = repositoryCarro;
     this._productoBLL     = productoBLL;
 }
Пример #17
0
 public BloqueoProductos(IProductoBLL productoBLL)
 {
     InitializeComponent();
     this.productoBLL = productoBLL;
     CargarProductos();
 }
Пример #18
0
 public CatalogoController()
 {
     productoBLL = new ProductoBLLImpl();
 }
Пример #19
0
 public CatalogoController(IProductoBLL productoBLL, IMarcaBLL MarcaBLL, IPedidoBLL PedidoBLL)
 {
     this._productoBLL = productoBLL;
     this._MarcaBLL    = MarcaBLL;
 }
Пример #20
0
 public CarritoController()
 {
     productoBLL = new ProductoBLLImpl();
 }
Пример #21
0
 public CarroController(IProductoBLL productoBLL, ICarroBLL carroBLL, IUsuarioBLL usuarioBLL)
 {
     this._productoBLL = productoBLL;
     this._carroBLL    = carroBLL;
     this._usuarioBLL  = usuarioBLL;
 }
Пример #22
0
 public ProductoController(IProductoBLL ProductoBLL, IMarcaBLL MarcaBLL)
 {
     this._productoBLL = ProductoBLL;
     this._marcaBLL    = MarcaBLL;
 }