Exemplo n.º 1
0
        public static WorkDocument GetDocumentByID(int documentID)
        {
            WorkDocument workDocument = BsoArchiveEntities.Current.WorkDocuments.FirstOrDefault(wa => wa.WorkDocumentID == documentID) ??
                                        WorkDocument.NewWorkDocument();

            return(workDocument);
        }
Exemplo n.º 2
0
        private static WorkDocument BuildWorkDocument(System.Xml.Linq.XElement node, int workDocumentID, WorkDocument workDocument)
        {
            WorkDocument doc = WorkDocument.NewWorkDocument();

            doc.WorkDocumentID           = workDocumentID;
            doc.WorkDocumentName         = (string)node.GetXElement(Constants.WorkDocument.workDocumentNameElement);
            doc.WorkDocumentNotes        = (string)node.GetXElement(Constants.WorkDocument.workDocumentNotesElement);
            doc.WorkDocumentSummary      = (string)node.GetXElement(Constants.WorkDocument.workDocumentSummaryElement);
            doc.WorkDocumentFileLocation = (string)node.GetXElement(Constants.WorkDocument.workDocumentFileLocationElement);
            return(doc);
        }
Exemplo n.º 3
0
        public static WorkDocument GetWorkDocumentFromNode(System.Xml.Linq.XElement node)
        {
            if (node == null || node.Element(Constants.WorkDocument.workDocumentIDElement) == null)
            {
                return(null);
            }

            int workDocumentID = 0;

            int.TryParse((string)node.GetXElement(Constants.WorkDocument.workDocumentIDElement), out workDocumentID);

            WorkDocument workDocument = WorkDocument.NewWorkDocument();

            return(BuildWorkDocument(node, workDocumentID, workDocument));
        }