public ActionResult Edit(DevicesViewModel deviceViewModel)
        {
            string error;
            _deviceService.UpdateDevice(deviceViewModel.CurrentDevice,out error);

            if (string.IsNullOrEmpty(error))
            {
                ViewBag.Result = "Success";
                return RedirectToAction("Index");
            }
            ViewBag.Result = error;
            return View(deviceViewModel);
        }
        public ActionResult Edit(int id)
        {
            var errors = new List<string>();
            string error;

            Device dev = _deviceService.GetDeviceById(id,out error);
            if(!string.IsNullOrEmpty(error))
                errors.Add(error);

            var devicesViewModel = new DevicesViewModel(dev, _deviceService.GetDeviceTypes(out error));
            if (!string.IsNullOrEmpty(error))
                errors.Add(error);

            return View(devicesViewModel);
        }