Exemplo n.º 1
0
        public List <IElectronicDocument> GetMeetingDocuments(string relationName)
        {
            var documentList = new List <IElectronicDocument>();
            var documents    = new List <IElectronicDocument>();

            documents.AddRange(Agendas.GetAll(a => Equals(a.Meeting, _obj)).ToList());
            documents.AddRange(Sungero.Meetings.Minuteses.GetAll(m => Equals(m.Meeting, _obj)).ToList());

            if (relationName == string.Empty)
            {
                foreach (var document in documents)
                {
                    documentList.AddRange(document.Relations.GetRelated().Union(document.Relations.GetRelatedFrom()).Distinct().ToList());
                }
            }
            else
            {
                foreach (var document in documents)
                {
                    documentList.AddRange(document.Relations.GetRelated(relationName).Union(document.Relations.GetRelatedFrom(relationName)).Distinct().ToList());
                }
            }

            documentList.AddRange(documents);
            documentList = documentList.Distinct().ToList();
            return(documentList);
        }
Exemplo n.º 2
0
        public List <IAgenda> GetOrCreateAgenda()
        {
            var agendaList = Agendas.GetAll(d => Equals(d.Meeting, _obj)).ToList();

            if (!agendaList.Any() && Docflow.PublicFunctions.Module.Remote.IsModuleAvailableForCurrentUserByLicense(Sungero.Meetings.Constants.Module.MeetingsUIGuid))
            {
                var agenda = Agendas.Create();
                agenda.Meeting = _obj;
                agendaList.Add(agenda);
            }
            return(agendaList);
        }