コード例 #1
0
        public ActionResult Borrar_lineafacturaespera(LineaFac lineaFac)
        {
            List <LineaFac> lineaFacs = (List <LineaFac>)Session["lineaFacs"];

            foreach (LineaFac linea in lineaFacs)
            {
                if (linea.articulo == lineaFac.articulo)
                {
                    lineaFacs.Remove(linea);
                    break;
                }
            }
            return(Json(new { success = true, data = lineaFac, modificar = true }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
 public ActionResult Agregar_ModificarListarFacturaEspera(LineaFac lineaFac)
 {
     if (lineaFac.cantidad < 1)
     {
         return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         List <LineaFac> lineaFacs = (List <LineaFac>)Session["lineaFacs"];
         foreach (LineaFac linea in lineaFacs)
         {
             if (linea.articulo == lineaFac.articulo)
             {
                 linea.cantidad = lineaFac.cantidad;
                 linea.precio   = lineaFac.precio;
                 return(Json(new { success = true, data = lineaFac, modificar = true }, JsonRequestBehavior.AllowGet));
             }
         }
         lineaFacs.Add(lineaFac);
         Session["lineaFacs"] = lineaFacs;
         return(Json(new { success = true, data = lineaFac, modificar = false }, JsonRequestBehavior.AllowGet));
     }
 }