コード例 #1
0
        public async Task <ActionResult> EditAsync([Bind("id,cmail,cDepartment,cCategory,cSeverity,cDescription,cblobpath,CwdDescription,completed,ByWhom")] TicketHistory item)
        {
            if (ModelState.IsValid)
            {
                await DocumentDBRespository <TicketHistory> .UpdateItemAsync(item.id, item);

                return(RedirectToAction("Index"));
            }
            return(View(item));
        }
コード例 #2
0
        EditAsync([Bind("Id,drugname,description,price,stock")] Drugs item, IFormFile file)
        {
            if (ModelState.IsValid)
            {
                var imageUrl = UploadBlob(file);
                item.imageURL = imageUrl.ToString();
                await DocumentDBRespository <Drugs> .UpdateItemAsync(item.Id, item);

                return(RedirectToAction("Index"));
            }
            return(View(item));
        }
コード例 #3
0
        public async Task <ActionResult> OrderAsync([Bind("Id,drugname,description,price,imageURL,stock")] Drugs item, string quantity)
        {
            int number = Convert.ToInt32(quantity);

            if (ModelState.IsValid)
            {
                item.stock = item.stock - number;
                await DocumentDBRespository <Drugs> .UpdateItemAsync(item.Id, item);

                TempData["redirect"] = number * item.price;
                //ViewBag.payment = number * item.price;
                return(RedirectToAction("Payment"));
            }
            return(View(item));
        }