コード例 #1
0
        public JsonResult TallasVenta(string Cod_Venta)
        {
            var bussingLogic = new SL.BusinessLogic.BLVentas();
            var response     = bussingLogic.TallasVenta(Cod_Venta);

            return(Json(response));
        }
コード例 #2
0
        public JsonResult DeleteVentas(Ventas obj)
        {
            var bussingLogic = new SL.BusinessLogic.BLVentas();

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

            return(Json(response));
        }
コード例 #3
0
 public JsonResult GetAllVentas(Ventas obj)
 {
     try
     {
         Session["ReporteVenta"] = null;
         var bussingLogic = new SL.BusinessLogic.BLVentas();
         var response     = bussingLogic.GetAllVentas(obj);
         Session["ReporteVenta"] = response.Data.ToList();
         return(Json(response));
     }
     catch (Exception ex)
     {
         var result = new SL.Common.Response <List <SL.Entities.Ventas> >(ex);
         return(Json(result));
     }
 }
コード例 #4
0
        public JsonResult GetVentas(Ventas obj)
        {
            try
            {
                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 bussingLogic = new SL.BusinessLogic.BLVentas();
                var response     = bussingLogic.GetVentas(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(SL.Common.ConfigurationUtilities.ErrorCatchDataTable(ex)));
            }
        }
コード例 #5
0
        public JsonResult InsertUpdateVentas(Ventas obj)
        {
            var bussingLogic = new SL.BusinessLogic.BLVentas();

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

            var tallasxml = obj.Tallas_Venta.Select(i => new XElement("TallaVenta",
                                                                      new XElement("Talla", i.Talla),
                                                                      new XElement("IdProducto", i.IdProducto),
                                                                      new XElement("Cantidad", i.Cantidad),
                                                                      new XElement("Precio", i.Precio_Prod)));

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

            var response = bussingLogic.InsertUpdateVentas(obj);

            return(Json(response));
        }