Пример #1
0
        public JsonResult TallasVenta(string Cod_Prod)
        {
            var bussingLogic = new SL.BusinessLogic.BLProducto();
            var response     = bussingLogic.TallasVenta(Cod_Prod);

            return(Json(response));
        }
Пример #2
0
        public JsonResult TallasProducto(string IdProducto)
        {
            var bussingLogic = new SL.BusinessLogic.BLProducto();
            var response     = bussingLogic.TallasProducto(IdProducto);

            return(Json(response));
        }
Пример #3
0
        public JsonResult TallasProducto(string IdProducto)
        {
            var bussingLogic = new SL.BusinessLogic.BLProducto();
            var response     = bussingLogic.TallasProducto(IdProducto);
            var result       = new Response <IEnumerable <Tallas> >(response.Data.Where(x => x.Cantidad > 0));

            return(Json(result));
        }
Пример #4
0
        public JsonResult DeleteProducto(Producto obj)
        {
            var bussingLogic = new SL.BusinessLogic.BLProducto();

            obj.Auditoria = new Auditoria
            {
                UsuarioModificacion = User.Identity.Name
            };
            var response = bussingLogic.DeleteProducto(obj);

            return(Json(response));
        }
Пример #5
0
 public JsonResult GetAllProductos(Producto obj)
 {
     try
     {
         Session["ReporteProducto"] = null;
         var bussingLogic = new SL.BusinessLogic.BLProducto();
         var response     = bussingLogic.GetAllProductos(obj);
         Session["ReporteProducto"] = response.Data.ToList();
         return(Json(response));
     }
     catch (Exception ex)
     {
         var result = new SL.Common.Response <List <Producto> >(ex);
         return(Json(result));
     }
 }
Пример #6
0
        public JsonResult GetProducto(Producto obj)
        {
            try
            {
                var bussingLogic = new SL.BusinessLogic.BLProducto();
                obj.Stock_Prod  = 1;
                obj.Estado_Prod = 1;
                var ctx         = HttpContext.GetOwinContext();
                var tipoUsuario = ctx.Authentication.User.Claims.FirstOrDefault().Value;

                string draw   = Request.Form.GetValues("draw")[0];
                int    inicio = Convert.ToInt32(Request.Form.GetValues("start").FirstOrDefault());
                int    fin    = Convert.ToInt32(Request.Form.GetValues("length").FirstOrDefault());

                obj.Auditoria = new Auditoria
                {
                    TipoUsuario = tipoUsuario
                };
                obj.Operacion = new Operacion
                {
                    Inicio = (inicio / fin),
                    Fin    = fin
                };

                var response     = bussingLogic.GetProducto(obj);
                var Datos        = response.Data;
                int totalRecords = Datos.Any() ? Datos.FirstOrDefault().Operacion.TotalRows : 0;
                int recFilter    = totalRecords;

                var result = (new
                {
                    draw = Convert.ToInt32(draw),
                    recordsTotal = totalRecords,
                    recordsFiltered = recFilter,
                    data = Datos
                });

                return(Json(result));
            }
            catch (Exception ex)
            {
                return(Json(ConfigurationUtilities.ErrorCatchDataTable(ex)));
            }
        }
Пример #7
0
        public JsonResult InsertUpdateProducto(Producto obj)
        {
            var bussingLogic = new SL.BusinessLogic.BLProducto();

            obj.Auditoria = new Auditoria
            {
                UsuarioCreacion     = User.Identity.Name,
                UsuarioModificacion = User.Identity.Name
            };

            var tallasxml = obj.Tallas_Prod.Select(i => new XElement("Talla",
                                                                     new XElement("talla", i.Talla),
                                                                     new XElement("idproducto", i.IdProducto),
                                                                     new XElement("cantidad", i.Cantidad)));

            obj.TallasXml = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("Tallas", tallasxml));

            var response = bussingLogic.InsertUpdateProducto(obj);

            return(Json(response));
        }