Пример #1
0
        public IActionResult OnGet(int hardwareId)
        {
            if (ModelState.IsValid)
            {
                HardwareInventory       = hardwareData.GetHardwareById(hardwareId);
                SoftwareInventory       = softwareData.GetSoftwareByName(HardwareInventory.ComputerName);
                DellWarrantyInformation = dellWarrantyData.GetWarrantyBySerial(HardwareInventory.SerialNumber);
                HPWarrantyInformation   = hpWarrantyData.GetWarrantyBySerial(HardwareInventory.SerialNumber);
            }



            if (HardwareInventory == null)
            {
                TempData["Message"] = "Hardware";
                return(RedirectToPage("/Shared/NotFound"));
            }
            else
            {
                return(Page());
            }
        }
Пример #2
0
        public IActionResult OnGet(string?hardwareId)
        {
            Locations = HtmlHelper.GetEnumSelectList <HardwareInventory.HDLocation>();
            //HardwareInventory = hardwareData.GetHardwareById(hardwareId);

            if (!string.IsNullOrEmpty(hardwareId))
            {
                HardwareInventory = hardwareData.GetHardwareById(Convert.ToInt32(hardwareId));
            }
            else
            {
                HardwareInventory = new TblInventory();
            }

            if (HardwareInventory == null)
            {
                TempData["Message"] = "Hardware";
                return(RedirectToPage("/Shared/NotFound"));
            }
            else
            {
                return(Page());
            }
        }