public ActionResult AddOrder(FormCollection collection)
        {
            try
            {
                Medication        newmedication  = new Medication();
                List <Medication> showMedication = Storage.Instance.showMedication;
                var solicitud = int.Parse(collection["cantidad"]);
                foreach (var item in showMedication)
                {
                    newmedication = item;
                }
                if (newmedication.Stock >= solicitud)
                {
                    int oldStock = newmedication.Stock;
                    ViewBag.Confirmation = "Solicitud aceptada y descargada con exito del inventario";
                    ViewBag.Error        = null;
                    ReadFile.editStock(newmedication.Id, newmedication.Stock - solicitud, Server.MapPath("~/Inventories/"));
                    newmedication.Stock = solicitud;
                    Storage.Instance.showCar.Add(newmedication);
                    Storage.Instance.showMedication = ReadFile.SearcInFile(newmedication.Id);

                    return(View("Order"));
                }
                else
                {
                    ViewBag.Error = "No hay suficientes ecistencias del producto";
                    return(View("Order", Storage.Instance.showMedication));
                }
            }
            catch (Exception)
            {
                ViewBag.Error = "Formato de solicitud invalido intentelo de nuevo";
                return(View("Order", Storage.Instance.showMedication));
            }
        }
        public ActionResult searchMedicament(FormCollection collection)
        {
            var readFile       = new ReadFile();
            var nameDrug       = collection["search"];
            var indicesearched = new Indice
            {
                nameDrug = collection["search"]
            };
            var found = Storage.Instance.binaryTree.search(indicesearched, Indice.comparisonbyName);

            if (found != null)
            {
                return(View("Order", ReadFile.SearcInFile(found.Value.lineNumber)));
            }
            else
            {
                ViewBag.mensage = "Medicamento no encontrado";
                return(View("Order"));
            }
        }