Beispiel #1
0
        public async Task <ActionResult> DetailsAsync(string id)
        {
            if (id == null)
            {
                return(BadRequest());
            }
            Drugs item = await DocumentDBRespository <Drugs> .GetItemAsync(id);

            if (item == null)
            {
                return(NotFound());
            }
            return(View(item));
        }
        public async Task <ActionResult> EditAsync(string id)
        {
            if (id == null)
            {
                return(BadRequest());
            }
            TicketHistory item = await DocumentDBRespository <TicketHistory> .GetItemAsync(id);

            if (item == null)
            {
                return(NotFound());
            }
            return(View(item));
        }
Beispiel #3
0
        public async Task <ActionResult> OrderAsync(string id)
        {
            if (id == null)
            {
                return(BadRequest());
            }
            Drugs item = await DocumentDBRespository <Drugs> .GetItemAsync(id);

            if (item == null)
            {
                return(NotFound());
            }
            if (item.stock == 0)
            {
                TempData["redirect"] = "No stock for this drug";
                return(RedirectToAction("DrugList"));
            }
            return(View(item));
        }