public void DeletePreservationStorageDevice(PreservationStorageDevice preservationStorageDevice) { try { var svc = new PreservationService(); svc.DeletePreservationStorageDevice(preservationStorageDevice); } catch (Exception ex) { throw CheckExceptionToThrow(ex); } }
public PreservationStorageDevice AddPreservationStorageDevice(PreservationStorageDevice toAdd) { var svc = new PreservationService(); try { return(svc.AddPreservationStorageDevice(toAdd)); } catch (Exception ex) { throw CheckExceptionToThrow(ex); } }
internal static PreservationStorageDevice Convert(this BibDSModel.PreservationStorageDevice sto, int level = 0, int deeplevel = 5, params Type[] ignoredTypes) { if (sto == null || level > deeplevel) { return(null); } var ret = new PreservationStorageDevice { DateCreated = sto.DateCreated, DateStorageDevice = sto.DateStorageDevice, IdPreservationStorageDevice = sto.IdPreservationStorageDevice, Label = sto.Label, LastVerifyDate = sto.LastVerifyDate, Location = sto.Location, //PreservationsInDevice = sto.PreservationInStorageDevice.Convert(level + 1, deeplevel, ignoredTypes), //Status = sto.PreservationStorageDeviceStatus.Convert(level + 1, deeplevel), User = new PreservationUser { DomainUser = sto.DomainUser }, OriginalPreservationStorageDevice = (sto.PreservationStorageDevice2 != null) ? sto.PreservationStorageDevice2.Convert(level + 1, deeplevel, ignoredTypes) : null, MinDate = sto.MinDate, MaxDate = sto.MaxDate, EntratelCompleteFileName = sto.EntratelCompleteFileName, EntratelUploadDate = sto.EntratelUploadDate, Company = sto.Company, }; var tipiIgnorati = ignoredTypes ?? new Type[0]; if (!tipiIgnorati.Contains(typeof(PreservationInStorageDevice))) { ret.PreservationsInDevice = sto.PreservationInStorageDevice.Convert(level + 1, deeplevel, ignoredTypes); } if (!tipiIgnorati.Contains(typeof(PreservationStorageDeviceStatus))) { ret.Status = sto.PreservationStorageDeviceStatus.Convert(level + 1, deeplevel); } return(ret); }
internal string CheckADEFile(PreservationStorageDevice device) { return(Path.Combine(workingDir, device.MinDate.GetValueOrDefault().Year.ToString(), device.Label + ".xml")); }