//[Route("dataset/{parentregister}/{registerowner}/{registername}/{itemowner}/{itemname}/slett")]
        //[Route("dataset/{registername}/{itemowner}/{itemname}/slett")]        //[Route("dataset/{registername}/{itemowner}/{itemname}/slett")]
        public ActionResult DeleteConfirmed(string registername, string itemname, string parentregister, string registerowner, string itemowner)
        {
            Dataset dataset = (Dataset)_registerItemService.GetCurrentRegisterItem(parentregister, registername, itemname);

            _registerItemService.DeleteCoverageByDatasetId(dataset.systemId);
            dataset.StatusHistories.Clear();
            _registerItemService.SaveDeleteRegisterItem(dataset);
            return(Redirect(RegisterUrls.registerUrl(parentregister, registerowner, registername)));
        }
        public ActionResult Edit(Models.Register register, string registername, string accessRegister)
        {
            if (IsAdmin())
            {
                if (_registerService.validationName(register))
                {
                    ModelState.AddModelError("ErrorMessage", Registers.ErrorMessageValidationName);
                }
                Models.Register originalRegister = _registerService.GetRegister(null, registername);

                if (ModelState.IsValid)
                {
                    if (register.name != null)
                    {
                        originalRegister.name = register.name;
                    }

                    if (register.description != null)
                    {
                        originalRegister.description = register.description;
                    }
                    if (register.ownerId != null)
                    {
                        originalRegister.ownerId = register.ownerId;
                    }
                    if (register.managerId != null)
                    {
                        originalRegister.managerId = register.managerId;
                    }
                    if (register.targetNamespace != null)
                    {
                        originalRegister.targetNamespace = register.targetNamespace;
                    }
                    originalRegister.accessId         = register.accessId;
                    originalRegister.parentRegisterId = register.parentRegisterId;
                    originalRegister.seoname          = RegisterUrls.MakeSeoFriendlyString(originalRegister.name);
                    originalRegister.modified         = DateTime.Now;
                    if (register.statusId != null)
                    {
                        originalRegister = _registerService.SetStatus(register, originalRegister);
                    }
                    _translationService.UpdateTranslations(register, originalRegister);
                    _db.Entry(originalRegister).State = EntityState.Modified;
                    _db.SaveChanges();
                    Viewbags(register);

                    return(Redirect(RegisterUrls.registerUrl(null, null, registername)));
                }
                Viewbags(register);
                return(View(originalRegister));
            }
            return(HttpNotFound());
        }