public Guid AddArchive(BiblosDS.Library.Common.Objects.DocumentArchive Archive) { Archive.IdArchive = Guid.NewGuid(); using (Model.BiblosDS2010Entities db = new Model.BiblosDS2010Entities(BiblosDSConnectionString)) { Model.Archive entityArchive = Archive.TryToConvertTo <Model.Archive>(db); db.AddToArchive(entityArchive); db.SaveChanges(); } return(Archive.IdArchive); }
public void UpdateArchive(BiblosDS.Library.Common.Objects.DocumentArchive Archive) { using (Model.BiblosDS2010Entities db = new Model.BiblosDS2010Entities(BiblosDSConnectionString)) { Model.Archive entityArchive = Archive.TryToConvertTo <Model.Archive>(false); if (entityArchive.EntityKey == null) { entityArchive.EntityKey = db.CreateEntityKey(entityArchive.GetType().Name, entityArchive); } var attachedEntity = db.GetObjectByKey(entityArchive.EntityKey) as Model.Archive; db.ApplyCurrentValues(entityArchive.EntityKey.EntitySetName, entityArchive); db.SaveChanges(); } }
public Document(Guid IdDocument, int IdBiblos, Guid?IdParentBiblos, DocumentStorageArea StorageArea, DocumentStorage Storage, DocumentArchive Archive, int ChainOrder, decimal Version, Guid?IdDocumentLink, Guid?IdCertificate, string SignHeader, string FullSign, string DocumentHash, bool?IsLinked, bool IsVisible, short?IsConservated, DateTime?DateExpire, string FileName, long?Size, DocumentNodeType NodeType, short?IsConfirmed, Status Status, short IsCheckOut) { this.IdDocument = IdDocument; this.IdBiblos = IdBiblos; if (IdParentBiblos != null) { this.DocumentParent = new Document((Guid)IdParentBiblos); } this.StorageArea = StorageArea; this.Archive = Archive; this.Storage = Storage; this.ChainOrder = ChainOrder; this.Version = Version; if (IdDocumentLink != null) { this.DocumentLink = new Document((Guid)IdDocumentLink); } if (IdCertificate != null) { this.Certificate = new DocumentCertificate((Guid)IdCertificate); } this.SignHeader = SignHeader; this.FullSign = FullSign; this.DocumentHash = DocumentHash; this.IsLinked = IsLinked; this.IsVisible = IsVisible; this.IsConservated = IsConservated.Equals(1); this.DateExpire = DateExpire; this.Name = FileName; this.Size = Size; this.NodeType = NodeType; this.IsConfirmed = IsConfirmed.Equals(1); this.Status = Status; this.IsCheckOut = IsCheckOut.Equals(1); this.IsRemoved = (IsDetached.HasValue && IsDetached.Value) || (Status != null && Status.IdStatus == (int)DocumentStatus.RemovedFromStorage); }
public DocumentArchiveStorage(DocumentArchive archive, DocumentStorage storage) { this.Archive = archive; this.Storage = storage; }