public ActionResult EditDevice(int Id)
        {
            ViewBag.CheckDv   = data.DeviceOfProjects.Where(x => x.DeviceId == Id).Count();
            ViewBag.CheckDvDv = data.DeviceDevices.Where(x => x.DeviceCodeChildren == Id || x.DeviceCodeParents == Id).Count();

            // ViewData EditDevice
            var DvType = data.DeviceById(Id).Select(x => x.TypeOfDevice).SingleOrDefault();
            int a      = Convert.ToInt32(DvType);

            ViewData["TypeOfProject"]         = data.DeviceOfProjects.Where(x => x.DeviceId == Id);
            ViewData["TypeOfDevice"]          = data.DeviceTypes.ToList();
            ViewData["User"]                  = data.Users.Where(x => x.IsDeleted == false & x.Status == 0).ToList();
            ViewData["Supplier"]              = data.Suppliers.ToList();
            ViewData["Device"]                = data.Devices.Where(x => x.IsDeleted == false).ToList();
            ViewData["ProjectDKC"]            = data.ProjectDKCs.Where(x => x.Status == 1 & x.TypeProject == 1 & x.IsDeleted == false).ToList();
            ViewData["sProjectDKC"]           = data.SearchProject(null, 1, 1, null).ToList();
            ViewData["RepairDetail"]          = data.SearchRepairDetails(null, null, Id, null).ToList();
            ViewData["DeviceHistory"]         = data.DeviceHistory().Where(x => x.DeviceId == Id).ToList();
            ViewData["UsageDevice"]           = data.SearchUseDevice(Id).ToList();
            ViewData["SearchDeviceComponant"] = data.SearchDevice(null, null, null, null, null).ToList();
            List <ChildrenOfDevice_Result> numbers = new List <ChildrenOfDevice_Result>();
            var lstTypeDevice = data.TypeComponantOfDevice(a).Where(x => x.IsDeleted == false).ToList();

            foreach (var item in lstTypeDevice)
            {
                var   lstTag = data.ChildrenOfDevice(Id, item.TypeSymbolChildren).ToList();
                Array a2     = lstTag.ToArray();
                numbers.Add(new ChildrenOfDevice_Result {
                    TypeName = item.NameTypeChildren, TypeSymbolChildren = item.TypeSymbolChildren, numbers = a2
                });
            }
            ViewData["TypeComponantOfDevice"] = numbers;
            //    public Array numbers { get; set; }

            // Danh sách thiết bị con theo loại của thiết bị cha
            var chart = data.DeviceById(Id).Single();

            return(View(chart));
        }