Ejemplo n.º 1
0
        public IActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            //Detail detail = service.FindById(id.Value);

            Tuple <long, Detail, List <ProductDetail>, List <AssetDetail> > detail = service.GetAllDetailsWithSub(id.Value);

            int qtyProductDetail = detail.Item3.Count();
            int qtyAssetDetail   = detail.Item4.Count();

            int qty = qtyProductDetail + qtyAssetDetail;

            ViewData["Qty"] = qty != 0 ? qty.ToString() : "0";

            ViewData["QtyProductDetail"]   = qtyProductDetail != 0 ? qtyProductDetail.ToString() : "0";
            ViewData["ListProductDetails"] = new List <ProductDetail>(detail.Item3);

            ViewData["QtyAssetDetail"]   = qtyAssetDetail != 0 ? qtyAssetDetail.ToString() : "0";
            ViewData["ListAssetDetails"] = new List <AssetDetail>(detail.Item4);


            if (detail == null)
            {
                return(NotFound());
            }

            return(View(detail.Item2));
        }