Esempio n. 1
0
        public JsonResult DeleteVentasMayor(Annies.Entities.VentasMayor obj)
        {
            var bussingLogic = new Annies.BusinessLogic.VentasMayor();

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

            return(Json(response));
        }
Esempio n. 2
0
 public JsonResult GetAllVentasMayor(Annies.Entities.VentasMayor obj)
 {
     try
     {
         Session["ReporteVentaMayor"] = null;
         var bussingLogic = new Annies.BusinessLogic.VentasMayor();
         var response     = bussingLogic.GetAllVentasMayor(obj);
         Session["ReporteVentaMayor"] = response.Data.ToList();
         return(Json(response));
     }
     catch (Exception ex)
     {
         var result = new Annies.Common.Response <List <Annies.Entities.VentasMayor> >(ex);
         return(Json(result));
     }
 }
Esempio n. 3
0
        public JsonResult GetVentasMayor(Annies.Entities.VentasMayor 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 Annies.BusinessLogic.VentasMayor();
                var response     = bussingLogic.GetVentasMayor(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(Annies.Common.ConfigurationUtilities.ErrorCatchDataTable(ex)));
            }
        }
Esempio n. 4
0
        public JsonResult InsertUpdateVentasMayor(Annies.Entities.VentasMayor obj)
        {
            var bussingLogic = new Annies.BusinessLogic.VentasMayor();

            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("Cod_prod", i.Cod_Prod),
                                                                      new XElement("Cantidad", i.Cantidad),
                                                                      new XElement("Precio", i.Precio_Prod_Mayor)));

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

            var response = bussingLogic.InsertUpdateVentas(obj);

            return(Json(response));
        }