Exemple #1
0
        DocumentFields IFieldService.GetAllAssignedFields(Guid SubmittedDocId, string UserId)
        {
            DocumentFields fields;

            if (string.IsNullOrEmpty(UserId))
            {
                fields = new DocumentFields()
                {
                    CheckBoxes      = _context.DocumentCheckBoxField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList(),
                    SignatureFields = _context.DocumentSignatureField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList(),
                    FormFields      = _context.DocumentFormField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList()
                };
            }
            else
            {
                fields = new DocumentFields()
                {
                    CheckBoxes = _context.DocumentCheckBoxField
                                 .Where(e => e.IdSubmittedDocumentId == SubmittedDocId && e.AssigneeId == UserId)
                                 .ToList(),
                    SignatureFields = _context.DocumentSignatureField
                                      .Where(e => e.IdSubmittedDocumentId == SubmittedDocId && e.AssigneeId == UserId)
                                      .ToList(),
                    FormFields = _context.DocumentFormField
                                 .Where(e => e.IdSubmittedDocumentId == SubmittedDocId && e.AssigneeId == UserId)
                                 .ToList()
                };
            }
            return(fields);
        }
Exemple #2
0
        public DocumentFields GetAllFields(Guid SubmittedDocId)
        {
            DocumentFields fields = new DocumentFields()
            {
                CheckBoxes      = _context.DocumentCheckBoxField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList(),
                SignatureFields = _context.DocumentSignatureField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList(),
                FormFields      = _context.DocumentFormField.Where(e => e.IdSubmittedDocumentId == SubmittedDocId).ToList()
            };

            return(fields);
        }
Exemple #3
0
        public DocumentFields GetAllAssignedFields(string UserId, bool ExcludeCompleted = false)
        {
            DocumentFields fields = new DocumentFields();

            if (ExcludeCompleted)
            {
                fields.CheckBoxes = _context.DocumentCheckBoxField
                                    .Include(e => e.SubmittedDocument)
                                    .Where(e => e.AssigneeId == UserId && e.IsActive &&
                                           !e.IsCompleted)
                                    .Distinct()
                                    .ToList();

                fields.FormFields = _context.DocumentFormField
                                    .Include(e => e.SubmittedDocument)
                                    .Where(e => e.AssigneeId == UserId && e.IsActive &&
                                           !e.IsCompleted)
                                    .Distinct()
                                    .ToList();

                fields.SignatureFields = _context.DocumentSignatureField
                                         .Include(e => e.SubmittedDocument)
                                         .Where(e => e.AssigneeId == UserId && e.IsActive &&
                                                !e.IsCompleted)
                                         .Distinct()
                                         .ToList();
            }
            else
            {
                fields.CheckBoxes = _context.DocumentCheckBoxField
                                    .Include(e => e.SubmittedDocument)
                                    .Where(e => e.AssigneeId == UserId && e.IsActive)
                                    .Distinct()
                                    .ToList();

                fields.FormFields = _context.DocumentFormField
                                    .Include(e => e.SubmittedDocument)
                                    .Where(e => e.AssigneeId == UserId && e.IsActive)
                                    .Distinct()
                                    .ToList();

                fields.SignatureFields = _context.DocumentSignatureField
                                         .Include(e => e.SubmittedDocument)
                                         .Where(e => e.AssigneeId == UserId && e.IsActive)
                                         .Distinct()
                                         .ToList();
            }

            return(fields);
        }