コード例 #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));
        }
コード例 #2
0
        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));
        }
コード例 #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));
        }