// GET: All_Device_Data/Edit/5
        public ActionResult Edit(short?id)
        {
            // Create lists of device types and subtypes to be used in drop-down lists
            NetInventoryEntities deviceTypeEntities = new NetInventoryEntities();
            var        getDeviceTypeList            = deviceTypeEntities.Device_Types_View.ToList();
            SelectList deviceTypeList = new SelectList(getDeviceTypeList, "type", "type");

            ViewBag.deviceTypeList = deviceTypeList;
            NetInventoryEntities deviceSubTypeEntities = new NetInventoryEntities();
            var        getDeviceSubTypeList            = deviceSubTypeEntities.device_types.ToList();
            SelectList deviceSubTypeList = new SelectList(getDeviceSubTypeList, "subtype", "subtype");

            ViewBag.deviceSubTypeList = deviceSubTypeList;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            All_Device_Data all_Device_Data = db.All_Device_Data.Find(id);

            if (all_Device_Data == null)
            {
                return(HttpNotFound());
            }
            return(View(all_Device_Data));
        }
        // GET: All_Device_Data/Create
        public ActionResult Create()
        {
            // Create lists of device types and subtypes to be used in drop-down lists
            NetInventoryEntities deviceTypeEntities = new NetInventoryEntities();
            var        getDeviceTypeList            = deviceTypeEntities.Device_Types_View.ToList();
            SelectList deviceTypeList = new SelectList(getDeviceTypeList, "type", "type");

            ViewBag.deviceTypeList = deviceTypeList;
            NetInventoryEntities deviceSubTypeEntities = new NetInventoryEntities();
            var        getDeviceSubTypeList            = deviceSubTypeEntities.device_types.ToList();
            SelectList deviceSubTypeList = new SelectList(getDeviceSubTypeList, "subtype", "subtype");

            ViewBag.deviceSubTypeList = deviceSubTypeList;

            return(View());
        }