Пример #1
0
        private Notification GetProtocolToAccept()
        {
            try
            {
                Notification             model           = new Notification();
                CommonUtil               cutil           = new CommonUtil();
                NHibernateProtocolFinder _protocolFinder = new NHibernateProtocolFinder();
                _protocolFinder.IdTenantAOO          = _idTenantAOO;
                _protocolFinder.RestrictionOnlyRoles = true;
                _protocolFinder.OnlyExplicitRoles    = true;
                _protocolFinder.ProtocolRoleStatus   = ProtocolRoleStatus.ToEvaluate;
                DateTime dateFrom = DateTime.Today.AddDays(-DocSuiteContext.Current.ProtocolEnv.DesktopDayDiff);
                _protocolFinder.RegistrationDateFrom = dateFrom;
                cutil.ApplyProtocolFinderSecurity(ref _protocolFinder, SecurityType.Read);

                model.NotificationName  = NotificationType.ProtocolliDaAccettare.ToString();
                model.NotificationCount = _protocolFinder.Count();
                return(model);
            }
            catch (Exception ex)
            {
                FileLogger.Error(LogName.WebAPIClientLog, ex.Message, ex);
                throw;
            }
        }
Пример #2
0
        private Notification GetProtocolToDistribute()
        {
            try
            {
                Notification             model           = new Notification();
                NHibernateProtocolFinder _protocolFinder = new NHibernateProtocolFinder();
                CommonUtil cutil = new CommonUtil();
                _protocolFinder.IdTenantAOO = _idTenantAOO;
                _protocolFinder.LoadFetchModeFascicleEnabled = false;
                _protocolFinder.LoadFetchModeProtocolLogs    = false;
                _protocolFinder.NotDistributed = true;
                _protocolFinder.IdTypes        = DocSuiteContext.Current.ProtocolEnv.ProtocolDistributionTypologies;
                _protocolFinder.IdStatus       = (int)ProtocolStatusId.Attivo;
                int dayDiff = DocSuiteContext.Current.ProtocolEnv.DesktopDayDiff;
                _protocolFinder.RegistrationDateFrom = DateTime.Today.AddDays(-dayDiff);
                cutil.ApplyProtocolFinderSecurity(ref _protocolFinder, SecurityType.Distribute);

                model.NotificationName  = NotificationType.ProtocolliDaDistribuire.ToString();
                model.NotificationCount = _protocolFinder.Count();
                return(model);
            }
            catch (Exception ex)
            {
                FileLogger.Error(LogName.WebAPIClientLog, ex.Message, ex);
                throw;
            }
        }
Пример #3
0
        private Notification GetProtocolInvoiceNotRead()
        {
            try
            {
                Notification             model           = new Notification();
                CommonUtil               cutil           = new CommonUtil();
                NHibernateProtocolFinder _protocolFinder = new NHibernateProtocolFinder();
                _protocolFinder.LoadFetchModeFascicleEnabled = false;
                _protocolFinder.LoadFetchModeProtocolLogs    = false;
                _protocolFinder.IdStatus      = (int)ProtocolStatusId.Attivo;
                _protocolFinder.TopMaxRecords = DocSuiteContext.Current.ProtocolEnv.DesktopMaxRecords;
                DateTime dateFrom = DateTime.Today.AddDays(-DocSuiteContext.Current.ProtocolEnv.DesktopDayDiff);
                _protocolFinder.RegistrationDateFrom = dateFrom;
                cutil.ApplyProtocolFinderSecurity(ref _protocolFinder, SecurityType.Read);
                cutil.OnlyInvoiceContainer(ref _protocolFinder);
                _protocolFinder.ProtocolNotReaded = true;

                model.NotificationName  = NotificationType.ProtocolliDifatturaDaLeggere.ToString();
                model.NotificationCount = _protocolFinder.Count();
                return(model);
            }
            catch (Exception ex)
            {
                FileLogger.Error(LogName.WebAPIClientLog, ex.Message, ex);
                throw;
            }
        }
Пример #4
0
        private Notification GetProtocolRejected()
        {
            try
            {
                Notification             model           = new Notification();
                NHibernateProtocolFinder _protocolFinder = new NHibernateProtocolFinder();
                CommonUtil cutil = new CommonUtil();
                _protocolFinder.IdTenantAOO = _idTenantAOO;
                _protocolFinder.LoadFetchModeFascicleEnabled = false;
                _protocolFinder.LoadFetchModeProtocolLogs    = false;
                _protocolFinder.IdStatus = (int)ProtocolStatusId.Rejected;
                cutil.ApplyProtocolFinderSecurity(ref _protocolFinder, SecurityType.Read);

                model.NotificationName  = NotificationType.ProtocolliRigettati.ToString();
                model.NotificationCount = _protocolFinder.Count();
                return(model);
            }
            catch (Exception ex)
            {
                FileLogger.Error(LogName.WebAPIClientLog, ex.Message, ex);
                throw;
            }
        }