public override ICollection <DossierModel> MapCollection(ICollection <DossierTableValuedModel> model)
        {
            if (model == null)
            {
                return(new List <DossierModel>());
            }

            List <DossierModel> modelsTransformed = new List <DossierModel>();
            DossierModel        modelTransformed  = null;
            ICollection <DossierTableValuedModel> dossierRoles;
            ICollection <DossierTableValuedModel> dossierContacts;

            foreach (IGrouping <Guid, DossierTableValuedModel> dossierLookup in model.ToLookup(x => x.IdDossier))
            {
                modelTransformed = Map(dossierLookup.First(), new DossierModel());
                dossierRoles     = dossierLookup.ToLookup(x => x.Role_IdRole)
                                   .Select(f => f.First())
                                   .ToList();
                dossierContacts = dossierLookup.ToLookup(x => x.Contact_Incremental)
                                  .Select(f => f.First())
                                  .ToList();

                modelTransformed.Roles    = _mapperUnitOfWork.Repository <IDomainMapper <DossierTableValuedModel, DossierRoleModel> >().MapCollection(dossierRoles);
                modelTransformed.Contacts = _mapperUnitOfWork.Repository <IDomainMapper <IContactTableValuedModel, ContactModel> >().MapCollection(dossierContacts);

                modelsTransformed.Add(modelTransformed);
            }
            return(modelsTransformed);
        }
Ejemplo n.º 2
0
        public override FascicleModel Map(FascicleTableValuedModel entity, FascicleModel entityTransformed)
        {
            entityTransformed.Category         = _mapperUnitOfWork.Repository <IDomainMapper <ICategoryTableValuedModel, CategoryModel> >().Map(entity, null);
            entityTransformed.TenantAOO        = _mapperUnitOfWork.Repository <IDomainMapper <ITenantAOOTableValuedModel, TenantAOOModel> >().Map(entity, null);
            entityTransformed.Conservation     = entity.Conservation;
            entityTransformed.EndDate          = entity.EndDate;
            entityTransformed.FascicleObject   = entity.FascicleObject;
            entityTransformed.FascicleType     = entity.FascicleType;
            entityTransformed.VisibilityType   = entity.VisibilityType;
            entityTransformed.RegistrationUser = entity.RegistrationUser;
            entityTransformed.Manager          = entity.Manager;
            entityTransformed.Name             = entity.Name;
            entityTransformed.Note             = entity.Note;
            entityTransformed.Number           = entity.Number;
            entityTransformed.Rack             = entity.Rack;
            entityTransformed.RegistrationDate = entity.RegistrationDate;
            entityTransformed.RegistrationUser = entity.RegistrationUser;
            entityTransformed.StartDate        = entity.StartDate;
            entityTransformed.Title            = entity.Title;
            entityTransformed.UniqueId         = entity.UniqueId;
            entityTransformed.Year             = entity.Year;
            entityTransformed.MetadataValues   = entity.MetadataValues;
            entityTransformed.MetadataDesigner = entity.MetadataDesigner;
            entityTransformed.DSWEnvironment   = entity.DSWEnvironment;
            entityTransformed.LastChangedDate  = entity.LastChangedDate;

            return(entityTransformed);
        }
Ejemplo n.º 3
0
 public override VecompSoftwareFascicle.FascicleModel Map(Fascicle entity, VecompSoftwareFascicle.FascicleModel modelTransformed)
 {
     modelTransformed.UniqueId              = entity.UniqueId;
     modelTransformed.Year                  = entity.Year;
     modelTransformed.Number                = entity.Number;
     modelTransformed.Conservation          = entity.Conservation;
     modelTransformed.StartDate             = entity.StartDate;
     modelTransformed.EndDate               = entity.EndDate;
     modelTransformed.Name                  = entity.Name;
     modelTransformed.Title                 = entity.Title;
     modelTransformed.FascicleObject        = entity.FascicleObject;
     modelTransformed.RegistrationDate      = entity.RegistrationDate;
     modelTransformed.RegistrationUser      = entity.RegistrationUser;
     modelTransformed.Manager               = entity.Manager;
     modelTransformed.Rack                  = entity.Rack;
     modelTransformed.Note                  = entity.Note;
     modelTransformed.FascicleType          = (VecompSoftwareFascicle.FascicleType)entity.FascicleType;
     modelTransformed.VisibilityType        = (VecompSoftwareFascicle.VisibilityType)entity.VisibilityType;
     modelTransformed.MetadataValues        = entity.MetadataValues;
     modelTransformed.MetadataDesigner      = entity.MetadataDesigner;
     modelTransformed.DSWEnvironment        = entity.DSWEnvironment;
     modelTransformed.CustomActions         = entity.CustomActions;
     modelTransformed.FascicleDocumentUnits = _mapperUnitOfWork.Repository <IDomainMapper <FascicleDocumentUnit, VecompSoftwareFascicle.FascicleDocumentUnitModel> >().MapCollection(entity.FascicleDocumentUnits);
     modelTransformed.FascicleDocuments     = _mapperUnitOfWork.Repository <IDomainMapper <FascicleDocument, VecompSoftwareFascicle.FascicleDocumentModel> >().MapCollection(entity.FascicleDocuments);
     modelTransformed.Category              = entity.Category == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Category, CategoryModel> >().Map(entity.Category, new CategoryModel());
     modelTransformed.Container             = entity.Container == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Container, ContainerModel> >().Map(entity.Container, new ContainerModel());
     modelTransformed.Contacts              = entity.Contacts == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Contact, ContactModel> >().MapCollection(entity.Contacts);
     modelTransformed.DossierFolders        = entity.DossierFolders == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <DossierFolder, DossierFolderModel> >().MapCollection(entity.DossierFolders);
     modelTransformed.FascicleTemplate      = entity.FascicleTemplate == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <ProcessFascicleTemplate, ProcessFascicleTemplateModel> >().Map(entity.FascicleTemplate, new ProcessFascicleTemplateModel());
     modelTransformed.LastChangedDate       = entity.LastChangedDate;
     return(modelTransformed);
 }
Ejemplo n.º 4
0
        public override CollaborationModel Map(Collaboration entity, CollaborationModel modelTransformed)
        {
            modelTransformed.IdCollaboration  = entity.EntityId;
            modelTransformed.AlertDate        = entity.AlertDate;
            modelTransformed.DocumentType     = entity.DocumentType;
            modelTransformed.IdPriority       = entity.IdPriority;
            modelTransformed.IdStatus         = entity.IdStatus;
            modelTransformed.MemorandumDate   = entity.MemorandumDate;
            modelTransformed.Note             = entity.Note;
            modelTransformed.Number           = entity.Number;
            modelTransformed.PublicationDate  = entity.PublicationDate;
            modelTransformed.PublicationUser  = entity.PublicationUser;
            modelTransformed.LastChangedDate  = entity.LastChangedDate;
            modelTransformed.RegistrationName = entity.RegistrationName;
            modelTransformed.RegistrationUser = entity.RegistrationUser;
            modelTransformed.SignCount        = entity.SignCount;
            modelTransformed.Subject          = entity.Subject;
            modelTransformed.Year             = entity.Year;
            modelTransformed.TemplateName     = entity.TemplateName;

            modelTransformed.CollaborationVersionings = _mapperUnitOfWork.Repository <IDomainMapper <CollaborationVersioning, CollaborationVersioningModel> >().MapCollection(entity.CollaborationVersionings).ToList();
            modelTransformed.CollaborationUsers       = _mapperUnitOfWork.Repository <IDomainMapper <CollaborationUser, CollaborationUserModel> >().MapCollection(entity.CollaborationUsers).ToList();
            modelTransformed.CollaborationSigns       = _mapperUnitOfWork.Repository <IDomainMapper <CollaborationSign, CollaborationSignModel> >().MapCollection(entity.CollaborationSigns).ToList();
            modelTransformed.DocumentSeriesItem       = entity.DocumentSeriesItem == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <DocumentSeriesItem, DocumentSeriesItemModel> >().Map(entity.DocumentSeriesItem, new DocumentSeriesItemModel());
            modelTransformed.Resolution = entity.DocumentSeriesItem == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Resolution, ResolutionModel> >().Map(entity.Resolution, new ResolutionModel());

            return(modelTransformed);
        }
Ejemplo n.º 5
0
        public override DocumentUnitModel Map(DocumentUnitTableValuedModel model, DocumentUnitModel modelTransformed)
        {
            modelTransformed.UniqueId         = model.UniqueId;
            modelTransformed.EntityId         = model.EntityId;
            modelTransformed.Environment      = model.Environment;
            modelTransformed.DocumentUnitName = model.DocumentUnitName;
            modelTransformed.Year             = model.Year;
            modelTransformed.Number           = model.Number;
            modelTransformed.Title            = model.Title;
            modelTransformed.ReferenceType    = model.ReferenceType;
            modelTransformed.RegistrationDate = model.RegistrationDate;
            modelTransformed.RegistrationUser = model.RegistrationUser;
            modelTransformed.Subject          = model.Subject;
            modelTransformed.IdUDSRepository  = model.IdUDSRepository;
            modelTransformed.IdFascicle       = model.IdFascicle;
            modelTransformed.IsFascicolable   = model.IsFascicolable;
            modelTransformed.MainDocumentName = model.DocumentUnitChain_DocumentName;

            modelTransformed.Category          = _mapperUnitOfWork.Repository <IDomainMapper <ICategoryTableValuedModel, CategoryModel> >().Map(model, null);
            modelTransformed.Container         = _mapperUnitOfWork.Repository <IDomainMapper <IContainerTableValuedModel, ContainerModel> >().Map(model, null);
            modelTransformed.DocumentUnitChain = _mapperUnitOfWork.Repository <IDomainMapper <DocumentUnitTableValuedModel, DocumentUnitChainModel> >().Map(model, null);
            modelTransformed.TenantAOO         = _mapperUnitOfWork.Repository <IDomainMapper <ITenantAOOTableValuedModel, TenantAOOModel> >().Map(model, null);

            return(modelTransformed);
        }
Ejemplo n.º 6
0
        public override CollaborationModel Map(CollaborationTableValuedModel model, CollaborationModel modelTransformed)
        {
            modelTransformed.IdCollaboration  = model.IdCollaboration;
            modelTransformed.AlertDate        = model.AlertDate;
            modelTransformed.DocumentType     = model.DocumentType;
            modelTransformed.IdPriority       = model.IdPriority;
            modelTransformed.IdStatus         = model.IdStatus;
            modelTransformed.MemorandumDate   = model.MemorandumDate;
            modelTransformed.Note             = model.Note;
            modelTransformed.Number           = model.Number;
            modelTransformed.PublicationDate  = model.PublicationDate;
            modelTransformed.PublicationUser  = model.PublicationUser;
            modelTransformed.RegistrationName = model.RegistrationName;
            modelTransformed.RegistrationUser = model.RegistrationUser;
            modelTransformed.LastChangedDate  = model.LastChangedDate;
            modelTransformed.SignCount        = model.SignCount;
            modelTransformed.Subject          = model.Subject;
            modelTransformed.Year             = model.Year;
            modelTransformed.TemplateName     = model.TemplateName;

            modelTransformed.Resolution         = _mapperUnitOfWork.Repository <IDomainMapper <CollaborationTableValuedModel, ResolutionModel> >().Map(model, null);
            modelTransformed.DocumentSeriesItem = _mapperUnitOfWork.Repository <IDomainMapper <CollaborationTableValuedModel, DocumentSeriesItemModel> >().Map(model, null);

            return(modelTransformed);
        }
Ejemplo n.º 7
0
 public IHttpActionResult GetFasciclesByCategory(ODataQueryOptions <FascicleModel> options, short idCategory, string name, bool?hasProcess)
 {
     return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric(() =>
     {
         ICollection <FascicleTableValuedModel> fasciclesModel = _unitOfWork.Repository <Fascicle>().GetByRight(Username, Domain, idCategory, name, hasProcess);
         ICollection <FascicleModel> fascicles = _mapperUnitOfwork.Repository <IDomainMapper <FascicleTableValuedModel, FascicleModel> >().MapCollection(fasciclesModel);
         return Ok(fascicles.OrderByDescending(x => x.RegistrationDate));
     }, _logger, LogCategories));
 }
Ejemplo n.º 8
0
 public IHttpActionResult FindCategory(ODataQueryOptions <Category> options, short idCategory, FascicleType?fascicleType)
 {
     return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric(() =>
     {
         ICollection <CategoryFullTableValuedModel> categories = _unitOfWork.Repository <Category>().FindByIdCategory(Username, Domain, idCategory, fascicleType);
         ICollection <CategoryModel> results = _mapperUnitOfWork.Repository <IDomainMapper <CategoryFullTableValuedModel, CategoryModel> >().MapCollection(categories);
         return Ok(results);
     }, _logger, LogCategories));
 }
Ejemplo n.º 9
0
 public IHttpActionResult FindContacts(ODataQueryOptions <Contact> options, [FromODataUri] ContactFinderModel finder)
 {
     return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric(() =>
     {
         ICollection <ContactTableValuedModel> contacts = _unitOfWork.Repository <Contact>().FindContacts(Username, Domain, finder);
         ICollection <ContactModel> results = _mapperUnitOfWork.Repository <IDomainMapper <ContactTableValuedModel, ContactModel> >().MapCollection(contacts);
         return Ok(results);
     }, _logger, LogCategories));
 }
Ejemplo n.º 10
0
 public override MessageModel Map(Message entity, MessageModel entityTransformed)
 {
     entityTransformed.IdMessage          = entity.EntityId;
     entityTransformed.MessageType        = (DocSuiteWeb.Model.Entities.Messages.MessageType)entity.MessageType;
     entityTransformed.RegistrationDate   = entity.RegistrationDate;
     entityTransformed.RegistrationUser   = entity.RegistrationUser;
     entityTransformed.Status             = (DocSuiteWeb.Model.Entities.Messages.MessageStatus)entity.Status;
     entityTransformed.MessageAttachments = _mapper.Repository <IMessageAttachmentModelMapper>().MapCollection(entity.MessageAttachments);
     entityTransformed.MessageEmails      = _mapper.Repository <IMessageEmailModelMapper>().MapCollection(entity.MessageEmails);
     entityTransformed.MessageContacts    = _mapper.Repository <IMessageContactModelMapper>().MapCollection(entity.MessageContacts);
     return(entityTransformed);
 }
Ejemplo n.º 11
0
        public IHttpActionResult GetAuthorizedDossiers(ODataQueryOptions <Dossier> options, ODataActionParameters parameter)
        {
            return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric <IHttpActionResult>(() =>
            {
                DossierFinderModel finder = parameter[ODataConfig.ODATA_FINDER_PARAMETER] as DossierFinderModel;
                IDictionary <string, string> metadataValues = finder.MetadataValues.ToDictionary(d => d.KeyName, d => _metadataFilterFactory.CreateMetadataFilter(d).ToFilter());
                ICollection <DossierTableValuedModel> dossierResults = _unitOfWork.Repository <Dossier>().GetAuthorized(Username, Domain, finder.Skip, finder.Top, finder.Year, finder.Number, finder.Subject, finder.IdContainer, finder.StartDateFrom,
                                                                                                                        finder.StartDateTo, finder.EndDateFrom, finder.EndDateTo, finder.Note, finder.IdMetadataRepository, finder.MetadataValue, metadataValues, finder.IdCategory, finder.DossierType, finder.Status);
                ICollection <DossierModel> dossierModels = _mapperUnitOfwork.Repository <IDomainMapper <DossierTableValuedModel, DossierModel> >().MapCollection(dossierResults);

                return Ok(dossierModels);
            }, _logger, LogCategories));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Ritorna informazione sull'utente specificato
        /// </summary>
        /// <param name="fullUserName"> Nome account nel formato [domain\account]</param>
        /// <returns></returns>
        public DomainUserModel GetUser(string fullUserName)
        {
            return(ActionHelper.TryUserPrincipalCatchWithLogger((d, x) =>
            {
                DomainUserModel user = _mapperUnitOfWork.Repository <IDomainUserModelMapper>().Map(x, new DomainUserModel(), d);
                try
                {
                    user.DomainGroups = _mapperUnitOfWork.Repository <IDomainGroupModelMapper>().MapCollection(x.GetAuthorizationGroups());
                }
                catch { }

                return user;
            }, _logger, _parameterEnvService, fullUserName, _cache_getCurrentUser, LogCategories));
        }
Ejemplo n.º 13
0
        public override ParameterModel Map(Parameter entity, ParameterModel modelTransformed)
        {
            modelTransformed.UniqueId                   = entity.UniqueId;
            modelTransformed.LastUsedYear               = entity.LastUsedYear;
            modelTransformed.LastUsedNumber             = entity.LastUsedNumber;
            modelTransformed.Locked                     = entity.Locked;
            modelTransformed.Password                   = entity.Password;
            modelTransformed.LastUsedidCategory         = entity.LastUsedIdCategory;
            modelTransformed.LastUsedidRecipient        = entity.LastUsedIdRecipient;
            modelTransformed.LastUsedidContainer        = entity.LastUsedIdContainer;
            modelTransformed.Version                    = entity.Version;
            modelTransformed.LastUsedidDistributionList = entity.LastUsedIdDistributionList;
            modelTransformed.DomainName                 = entity.DomainName;
            modelTransformed.AlternativePassword        = entity.AlternativePassword;
            modelTransformed.ServiceField               = entity.ServiceField;
            modelTransformed.LastUsedidRole             = entity.LastUsedIdRole;
            modelTransformed.LastUsedIdRoleUser         = entity.LastUsedIdRoleUser;
            modelTransformed.LastUsedidResolution       = entity.LastUsedIdResolution;
            modelTransformed.LastUsedResolutionYear     = entity.LastUsedResolutionYear;
            modelTransformed.LastUsedResolutionNumber   = entity.LastUsedResolutionNumber;
            modelTransformed.LastUsedBillNumber         = entity.LastUsedBillNumber;
            modelTransformed.LastUsedYearReg            = entity.LastUsedYearReg;
            modelTransformed.LastUsedNumberReg          = entity.LastUsedNumberReg;
            modelTransformed.RegistrationUser           = entity.RegistrationUser;
            modelTransformed.RegistrationDate           = entity.RegistrationDate;

            modelTransformed.TenantAOO = entity.TenantAOO != null?_mapperUnitOfWork.Repository <IDomainMapper <TenantAOO, TenantAOOModel> >().Map(entity.TenantAOO, new TenantAOOModel()) : null;

            return(modelTransformed);
        }
Ejemplo n.º 14
0
        public override DossierModel Map(Dossier entity, DossierModel modelTransformed)
        {
            modelTransformed.UniqueId         = entity.UniqueId;
            modelTransformed.Year             = entity.Year;
            modelTransformed.Number           = entity.Number;
            modelTransformed.Title            = string.Format("{0}/{1:0000000}", entity.Year, entity.Number);
            modelTransformed.Subject          = entity.Subject;
            modelTransformed.Note             = entity.Note;
            modelTransformed.RegistrationDate = entity.RegistrationDate;
            modelTransformed.RegistrationUser = entity.RegistrationUser;
            modelTransformed.LastChangedDate  = entity.LastChangedDate;
            modelTransformed.LastChangedUser  = entity.LastChangedUser;
            modelTransformed.StartDate        = entity.StartDate;
            modelTransformed.EndDate          = entity.EndDate;
            modelTransformed.MetadataDesigner = entity.MetadataDesigner;
            modelTransformed.MetadataValues   = entity.MetadataValues;
            modelTransformed.ContainerName    = entity.Container == null ? null : entity.Container.Name;
            modelTransformed.ContainerId      = entity.Container == null?short.Parse("0") : entity.Container.EntityShortId;

            modelTransformed.Category    = entity.Category == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Category, CategoryModel> >().Map(entity.Category, new CategoryModel());
            modelTransformed.DossierType = (DossierType)entity.DossierType;
            modelTransformed.Status      = (DossierStatus)entity.Status;

            return(modelTransformed);
        }
Ejemplo n.º 15
0
        public override UDSRepository Map(UDSRepositoryTableValuedModel model, UDSRepository entityTransformed)
        {
            #region [ Base ]

            entityTransformed.UniqueId              = model.IdUDSRepository;
            entityTransformed.Name                  = model.Name;
            entityTransformed.Version               = model.Version;
            entityTransformed.ActiveDate            = model.ActiveDate;
            entityTransformed.ExpiredDate           = model.ExpiredDate;
            entityTransformed.RegistrationUser      = model.RegistrationUser;
            entityTransformed.RegistrationDate      = model.RegistrationDate;
            entityTransformed.LastChangedUser       = model.LastChangedUser;
            entityTransformed.LastChangedDate       = model.LastChangedDate;
            entityTransformed.Alias                 = model.Alias;
            entityTransformed.DSWEnvironment        = model.DSWEnvironment;
            entityTransformed.SequenceCurrentNumber = model.SequenceCurrentNumber;
            entityTransformed.SequenceCurrentYear   = model.SequenceCurrentYear;
            entityTransformed.Name                  = model.Name;
            entityTransformed.Status                = (Entity.UDS.UDSRepositoryStatus)model.Status;
            entityTransformed.Container             = _mapperUnitOfWork.Repository <IDomainMapper <IContainerTableValuedModel, Container> >().Map(model, null);
            #endregion

            #region [ Navigation Properties ]

            #endregion

            return(entityTransformed);
        }
        public override ParameterModel Map(ParameterTableValuedModel model, ParameterModel modelTransformed)
        {
            modelTransformed.UniqueId                   = model.UniqueId;
            modelTransformed.LastUsedYear               = model.LastUsedYear;
            modelTransformed.LastUsedNumber             = model.LastUsedNumber;
            modelTransformed.Locked                     = model.Locked;
            modelTransformed.Password                   = model.Password;
            modelTransformed.LastUsedidCategory         = model.LastUsedidCategory;
            modelTransformed.LastUsedidRecipient        = model.LastUsedidRecipient;
            modelTransformed.LastUsedidContainer        = model.LastUsedidContainer;
            modelTransformed.Version                    = model.Version;
            modelTransformed.LastUsedidDistributionList = model.LastUsedidDistributionList;
            modelTransformed.DomainName                 = model.DomainName;
            modelTransformed.AlternativePassword        = model.AlternativePassword;
            modelTransformed.ServiceField               = model.ServiceField;
            modelTransformed.LastUsedidRole             = model.LastUsedidRole;
            modelTransformed.LastUsedIdRoleUser         = model.LastUsedIdRoleUser;
            modelTransformed.LastUsedidResolution       = model.LastUsedidResolution;
            modelTransformed.LastUsedResolutionYear     = model.LastUsedResolutionYear;
            modelTransformed.LastUsedResolutionNumber   = model.LastUsedResolutionNumber;
            modelTransformed.LastUsedBillNumber         = model.LastUsedBillNumber;
            modelTransformed.LastUsedYearReg            = model.LastUsedYearReg;
            modelTransformed.LastUsedNumberReg          = model.LastUsedNumberReg;
            modelTransformed.RegistrationUser           = model.RegistrationUser;
            modelTransformed.RegistrationDate           = model.RegistrationDate;

            modelTransformed.TenantAOO = _mapperUnitOfWork.Repository <IDomainMapper <ITenantAOOTableValuedModel, TenantAOOModel> >().Map(model, null);

            return(modelTransformed);
        }
Ejemplo n.º 17
0
 public override FascicleDocumentUnitModel Map(FascicleDocumentUnit entity, FascicleDocumentUnitModel entityTransformed)
 {
     entityTransformed.UniqueId      = entity.UniqueId;
     entityTransformed.ReferenceType = (VecompSoftwareFascicle.ReferenceType)entity.ReferenceType;
     entityTransformed.DocumentUnit  = _mapperUnitOfWork.Repository <IDomainMapper <DocumentUnit, DocumentUnitModel> >().Map(entity.DocumentUnit, new DocumentUnitModel());
     return(entityTransformed);
 }
Ejemplo n.º 18
0
        public override ResolutionModel Map(Resolution entity, ResolutionModel modelTransformed)
        {
            modelTransformed.IdResolution         = entity.EntityId;
            modelTransformed.Number               = entity.Number;
            modelTransformed.Year                 = entity.Year;
            modelTransformed.Subject              = entity.Object;
            modelTransformed.ServiceNumber        = entity.ServiceNumber;
            modelTransformed.AdoptionDate         = entity.AdoptionDate;
            modelTransformed.AlternativeAssignee  = entity.AlternativeAssignee;
            modelTransformed.AlternativeManager   = entity.AlternativeManager;
            modelTransformed.AlternativeProposer  = entity.AlternativeProposer;
            modelTransformed.AlternativeRecipient = entity.AlternativeRecipient;
            modelTransformed.ConfirmDate          = entity.ConfirmDate;
            modelTransformed.EffectivenessDate    = entity.EffectivenessDate;
            modelTransformed.LeaveDate            = entity.LeaveDate;
            modelTransformed.Number               = entity.Number;
            modelTransformed.ProposeDate          = entity.ProposeDate;
            modelTransformed.PublishingDate       = entity.PublishingDate;
            modelTransformed.ResponseDate         = entity.ResponseDate;
            modelTransformed.WaitDate             = entity.WaitDate;
            modelTransformed.WarningDate          = entity.WarningDate;
            modelTransformed.WorkflowType         = entity.WorkflowType;
            modelTransformed.ProposeUser          = entity.ProposeUser;
            modelTransformed.LeaveUser            = entity.LeaveUser;
            modelTransformed.EffectivenessUser    = entity.EffectivenessUser;
            modelTransformed.ResponseUser         = entity.ResponseUser;
            modelTransformed.WaitUser             = entity.WaitUser;
            modelTransformed.ConfirmUser          = entity.ConfirmUser;
            modelTransformed.WarningUser          = entity.WarningUser;
            modelTransformed.PublishingUser       = entity.PublishingUser;
            modelTransformed.AdoptionUser         = entity.AdoptionUser;
            modelTransformed.UniqueId             = entity.UniqueId;
            modelTransformed.RegistrationUser     = entity.AdoptionUser;
            modelTransformed.LastChangedUser      = entity.LastChangedUser;
            modelTransformed.Category             = _mapperUnitOfWork.Repository <IDomainMapper <Category, CategoryModel> >().Map(entity.Category, new CategoryModel());
            modelTransformed.Container            = _mapperUnitOfWork.Repository <IDomainMapper <Container, ContainerModel> >().Map(entity.Container, new ContainerModel());

            if (FileResolution != null)
            {
                modelTransformed.FileResolution = _mapperUnitOfWork.Repository <IDomainMapper <FileResolution, FileResolutionModel> >().Map(FileResolution, new FileResolutionModel());
            }
            if (ResolutionRoles != null && ResolutionRoles.Any())
            {
                modelTransformed.ResolutionRoles = _mapperUnitOfWork.Repository <IDomainMapper <ResolutionRole, ResolutionRoleModel> >().MapCollection(ResolutionRoles);
            }
            return(modelTransformed);
        }
Ejemplo n.º 19
0
        public override DossierRoleModel Map(DossierRole entity, DossierRoleModel modelTransformed)
        {
            modelTransformed.UniqueId = entity.UniqueId;
            modelTransformed.Role     = entity.Role == null ? null : _mapperUnitOfWork.Repository <IDomainMapper <Role, RoleModel> >().Map(entity.Role, new RoleModel());
            modelTransformed.IsMaster = entity.IsMaster;
            modelTransformed.Type     = (DocSuiteWeb.Model.Commons.AuthorizationRoleType)entity.AuthorizationRoleType;

            return(modelTransformed);
        }
Ejemplo n.º 20
0
        public IHttpActionResult GetChildrenByParent(ODataQueryOptions <FascicleFolder> options, Guid idFascicleFolder)
        {
            return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric <IHttpActionResult>(() =>
            {
                ICollection <FascicleFolderTableValuedModel> fascicleFolders = _unitOfWork.Repository <FascicleFolder>().GetChildrenByParent(idFascicleFolder);
                ICollection <FascicleFolderModel> fascicleFoldersModel = _mapperUnitOfwork.Repository <IDomainMapper <FascicleFolderTableValuedModel, FascicleFolderModel> >().MapCollection(fascicleFolders).ToList();

                return Ok(fascicleFoldersModel);
            }, _logger, LogCategories));
        }
Ejemplo n.º 21
0
 public IHttpActionResult GetRootDossierFolders(ODataQueryOptions <DossierFolder> options, Guid idDossier, short?status)
 {
     return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric <IHttpActionResult>(() =>
     {
         ICollection <DossierFolderTableValuedModel> dossierFolders = _unitOfWork.Repository <DossierFolder>().GetRootDossierFolders(idDossier, status);
         ICollection <DossierFolderModel> dossierFoldersModel = _mapperUnitOfwork.Repository <IDomainMapper <DossierFolderTableValuedModel, DossierFolderModel> >().MapCollection(dossierFolders).ToList();
         return Ok(dossierFoldersModel);
     }, _logger, LogCategories));
 }
Ejemplo n.º 22
0
        public IHttpActionResult AvailableProcesses(string name, short?categoryId, Guid?dossierId, bool loadOnlyMy)
        {
            return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric(() =>
            {
                ICollection <ProcessTableValuedModel> processes =
                    _unitOfWork.Repository <Process>().FindProcesses(Username, Domain, name, categoryId, dossierId, loadOnlyMy);
                ICollection <ProcessModel> processModels = _mapperUnitOfwork.Repository <IDomainMapper <ProcessTableValuedModel, ProcessModel> >().MapCollection(processes);

                return Ok(processModels);
            }, _logger, LogCategories));
        }
 public override MessageContactModel Map(MessageContact entity, MessageContactModel entityTransformed)
 {
     entityTransformed.IdMessageContact    = entity.EntityId;
     entityTransformed.ContactPosition     = (DocSuiteWeb.Model.Entities.Messages.MessageContantTypology)entity.ContactPosition;
     entityTransformed.ContactType         = (DocSuiteWeb.Model.Entities.Messages.MessageContactType)entity.ContactType;
     entityTransformed.Description         = entity.Description;
     entityTransformed.RegistrationDate    = entity.RegistrationDate;
     entityTransformed.RegistrationUser    = entity.RegistrationUser;
     entityTransformed.MessageContactEmail = _mapper.Repository <IMessageContactEmailModelMapper>().MapCollection(entity.MessageContactEmail);
     return(entityTransformed);
 }
        public override UDSBuildModel Map(DocumentUnit entity, UDSBuildModel entityTransformed)
        {
            #region [ Base ]

            entityTransformed.Year    = entity.Year;
            entityTransformed.Number  = entity.Number;
            entityTransformed.Subject = entity.Subject;
            entityTransformed.Title   = entity.Title;

            #endregion

            #region [ Navigation Properties ]
            entityTransformed.Category = entity.Category != null?_mapperUnitOfwork.Repository <IDomainMapper <Category, CategoryModel> >().Map(entity.Category, new CategoryModel()) : null;

            entityTransformed.Container = entity.Container != null?_mapperUnitOfwork.Repository <IDomainMapper <Container, ContainerModel> >().Map(entity.Container, new ContainerModel()) : null;

            entityTransformed.UDSRepository = entity.UDSRepository != null?_mapperUnitOfwork.Repository <IDomainMapper <UDSRepository, UDSRepositoryModel> >().Map(entity.UDSRepository, new UDSRepositoryModel()) : null;

            entityTransformed.XMLContent = entityTransformed.UDSRepository != null ? entityTransformed.UDSRepository.ModuleXML : null;
            entityTransformed.Roles      = _mapperUnitOfwork.Repository <IDomainMapper <DocumentUnitRole, RoleModel> >().MapCollection(entity.DocumentUnitRoles);
            entityTransformed.Documents  = _mapperUnitOfwork.Repository <IDomainMapper <DocumentUnitChain, UDSDocumentModel> >().MapCollection(entity.DocumentUnitChains);
            entityTransformed.Users      = _mapperUnitOfwork.Repository <IDomainMapper <DocumentUnitUser, UserModel> >().MapCollection(entity.DocumentUnitUsers);
            #endregion

            return(entityTransformed);
        }
        protected override TemplateCollaboration BeforeUpdate(TemplateCollaboration entity, TemplateCollaboration entityTransformed)
        {
            if (entity.TemplateCollaborationUsers != null)
            {
                foreach (TemplateCollaborationUser item in entity.TemplateCollaborationUsers.Where(f => entityTransformed.TemplateCollaborationUsers.Any(c => c.UniqueId == f.UniqueId)))
                {
                    TemplateCollaborationUser mappedUser = _mapperUnitOfWork.Repository <TemplateCollaborationUserMapper>().Map(item, entityTransformed.TemplateCollaborationUsers.First(c => c.UniqueId == item.UniqueId));
                    _unitOfWork.Repository <TemplateCollaborationUser>().Update(mappedUser);
                }
                foreach (TemplateCollaborationUser item in entityTransformed.TemplateCollaborationUsers.Where(f => !entity.TemplateCollaborationUsers.Any(c => c.UniqueId == f.UniqueId)).ToList())
                {
                    _unitOfWork.Repository <TemplateCollaborationUser>().Delete(item.UniqueId);
                }
                foreach (TemplateCollaborationUser item in entity.TemplateCollaborationUsers.Where(f => !entityTransformed.TemplateCollaborationUsers.Any(c => c.UniqueId == f.UniqueId)))
                {
                    item.TemplateCollaboration = entityTransformed;
                    if (item.Role != null)
                    {
                        item.Role = _unitOfWork.Repository <Role>().Find(item.Role.EntityShortId);
                    }
                    _unitOfWork.Repository <TemplateCollaborationUser>().Insert(item);
                }
            }

            if (entity.TemplateCollaborationDocumentRepositories != null)
            {
                foreach (TemplateCollaborationDocumentRepository item in entityTransformed.TemplateCollaborationDocumentRepositories.Where(f => !entity.TemplateCollaborationDocumentRepositories.Any(c => c.UniqueId == f.UniqueId)).ToList())
                {
                    entityTransformed.TemplateCollaborationDocumentRepositories.Remove(item);
                }
                foreach (TemplateCollaborationDocumentRepository item in entity.TemplateCollaborationDocumentRepositories.Where(f => !entityTransformed.TemplateCollaborationDocumentRepositories.Any(c => c.UniqueId == f.UniqueId)))
                {
                    item.TemplateCollaboration = entityTransformed;
                    //TODO: Gestire entità templatedocumentrepositories
                    _unitOfWork.Repository <TemplateCollaborationDocumentRepository>().Insert(item);
                }
            }

            if (entity.Roles != null)
            {
                foreach (Role item in entityTransformed.Roles.Where(f => !entity.Roles.Any(c => c.EntityShortId == f.EntityShortId)).ToList())
                {
                    entityTransformed.Roles.Remove(item);
                }
                foreach (Role item in entity.Roles.Where(f => !entityTransformed.Roles.Any(c => c.EntityShortId == f.EntityShortId)))
                {
                    entityTransformed.Roles.Add(_unitOfWork.Repository <Role>().Find(item.EntityShortId));
                }
            }
            _unitOfWork.Repository <TableLog>().Insert(TableLogService.CreateLog(entityTransformed.UniqueId, null, TableLogEvent.UPDATE, string.Concat("Modificato template collaborazione", entity.Name), typeof(TemplateCollaboration).Name, CurrentDomainUser.Account));
            return(base.BeforeUpdate(entity, entityTransformed));
        }
Ejemplo n.º 26
0
        public IHttpActionResult GetByDateInterval(string dateFrom, string dateTo, string userName, short?idContainer, int?environment)
        {
            DateTimeOffset dateFromOffset = DateTimeOffset.ParseExact(dateFrom, "yyyyMMddHHmmss", CultureInfo.InvariantCulture);
            DateTimeOffset dateToOffset   = DateTimeOffset.ParseExact(dateTo, "yyyyMMddHHmmss", CultureInfo.InvariantCulture);

            return(CommonHelpers.ActionHelper.TryCatchWithLoggerGeneric(() =>
            {
                IQueryable <TransparentAdministrationMonitorLog> transparentAdministrationMonitorResults = _unitOfWork.Repository <TransparentAdministrationMonitorLog>()
                                                                                                           .GetByDateInterval(dateFromOffset, dateToOffset, userName, idContainer, environment);
                IQueryable <TransparentAdministrationMonitorLogModel> results = _mapperUnitOfwork.Repository <IDomainMapper <TransparentAdministrationMonitorLog, TransparentAdministrationMonitorLogModel> >().MapCollection(transparentAdministrationMonitorResults).AsQueryable();
                return Ok(results);
            }, _logger, LogCategories));
        }
Ejemplo n.º 27
0
 protected BaseService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IValidatorRuleset validatorRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
 {
     _unitOfWork        = unitOfWork;
     _mapperUnitOfWork  = mapperUnitOfWork;
     _repositoryAsync   = unitOfWork.Repository <TEntity>();
     _logger            = logger;
     _validationService = validationService;
     _instanceId        = Guid.NewGuid();
     _validatorRuleset  = validatorRuleset;
     _mapper            = mapperUnitOfWork.Repository <IDomainMapper <TEntity, TEntity> >();
     _currentDomainUser = security.GetCurrentUser();
 }
        public override MessageContactModel Map(DomainUserModel entity, MessageContactModel entityTransformed)
        {
            #region [ Base ]
            entityTransformed.ContactPosition     = MessageContantTypology.Recipient;
            entityTransformed.ContactType         = MessageContactType.User;
            entityTransformed.Description         = entity.DisplayName;
            entityTransformed.MessageContactEmail = _mapper.Repository <IDomainUserModelMessageContactEmailModelMapper>().MapCollection(new List <DomainUserModel>()
            {
                entity
            });
            #endregion

            return(entityTransformed);
        }
        public async Task <IHttpActionResult> Get(string topicName, string subscriptionName, Guid?correlationId)
        {
            return(await ActionHelper.TryCatchWithLoggerGeneric(async() =>
            {
                await _service.InitializeAsync(topicName, subscriptionName);
                IEnumerable <ServiceBusMessage> messages = await _service.GetMessagesFromTopicAsync();
                if (correlationId.HasValue)
                {
                    messages = messages.Where(x => x.CorrelationId == correlationId.Value.ToString()).ToList();
                }

                IEnumerable <ServiceBusTopicMessage> result = _mapperUnitOfWork.Repository <IServiceTopicMessageMapper>().MapCollection(messages.ToList());
                return Ok(result);
            }, _logger, LogCategories));
        }
Ejemplo n.º 30
0
        private ICollection <UDSRole> GetEntityRoles(ICollection <UDSRoleModel> roleModels, UDSRepository repository)
        {
            ICollection <UDSRole> roles = new List <UDSRole>();
            UDSRole udsRole;

            foreach (UDSRoleModel roleModel in roleModels)
            {
                udsRole             = _mapperUnitOfWork.Repository <IUDSRoleEntityMapper>().Map(roleModel, new UDSRole());
                udsRole.Relation    = _unitOfWork.Repository <Role>().Find(roleModel.IdRole);
                udsRole.Environment = repository.DSWEnvironment;
                udsRole.Repository  = repository;
                roles.Add(udsRole);
            }
            return(roles);
        }