コード例 #1
0
        public async Task <IActionResult> Detail(int labID)
        {
            Laboratory        labDetail   = LabDB.GetByID(labID);
            List <ItemDetail> itemDetails = await ItemDB.GetAllDetailByLabIDAsync(labID);

            List <int> itemSet = await ItemDB.GetItemSetByLabIDAsync(labID);

            List <int> itemQuantity = await ItemDB.GetAllQuantityByLabIDAsync(labID);

            itemDetails.ForEach(item =>
            {
                if (!itemSet.Contains(item.type))
                {
                    itemSet.Add(item.type);
                }
            });

            ViewData["LabDetail"]    = labDetail;
            ViewData["ItemSet"]      = itemSet;
            ViewData["ItemQuantity"] = itemQuantity;
            ViewData["LabID"]        = labID;

            return(View());
        }