Exemple #1
0
        private void SendOnInputLimitExecutorSighting(BillDemand billDemand)
        {
            var limits      = GetLimits(billDemand, false);
            var executorIds = new List <Guid>();

            limits.Where(lim => lim.ExecutorId.HasValue).ForEach(lim => executorIds.Add(lim.ExecutorId.Value));
            var employees = EmployeeService.GetEmployeesBySecurityTrusteeIdsForNotification(executorIds, billDemand.BudgetId, true);

            SendMailsToEmployee(employees, billDemand, WorkflowState.BillDemandLimitExecutorSighting);
        }
        private void SendOnAgreementOPExpertSighting(Demand demand)
        {
            if (!demand.AgreementCfo.HasValue)
            {
                return;
            }
            var identityIds = EmployeeService.GetAllTrusteeInStructDivisionIds(demand.AgreementCfo.Value);
            var employees   = EmployeeService.GetEmployeesBySecurityTrusteeIdsForNotification(identityIds, demand.BudgetVersion.BudgetId, true);

            SendMailsToEmployee(employees, demand, WorkflowState.DemandAgreementOPExpertSighting);
        }
Exemple #3
0
        private void SendOnInputLimitManagerSighting(BillDemand billDemand)
        {
            var limits        = GetLimits(billDemand, false);
            var managerIds    = new List <Guid>();
            var sightedLimits = SightedByManagerLimitIds(billDemand);

            limits.Where(lim => lim.ManagerId.HasValue && !sightedLimits.Contains(lim.Id)).ForEach(lim => managerIds.Add(lim.ExecutorId.Value));
            var employees = EmployeeService.GetEmployeesBySecurityTrusteeIdsForNotification(managerIds, billDemand.BudgetId, true);

            SendMailsToEmployee(employees, billDemand, WorkflowState.BillLimitManagerSighting);
        }
        private void SendOnInitiatorHeadSighting(Demand demand)
        {
            if (!demand.AuthorId.HasValue)
            {
                return;
            }
            var identityIds = SecurityEntityService.GetHeadIds(demand.AuthorId.Value, demand.BudgetVersion.BudgetId);
            var employees   = EmployeeService.GetEmployeesBySecurityTrusteeIdsForNotification(identityIds,
                                                                                              demand.BudgetVersion.
                                                                                              BudgetId, true);

            SendMailsToEmployee(employees, demand, WorkflowState.DemandInitiatorHeadSighting);
        }
Exemple #5
0
        private void SendOnInputHeadInitiatorSighting(BillDemand billDemand)
        {
            if (!billDemand.AuthorId.HasValue)
            {
                throw new InvalidOperationException("billDemand.AuthorId is null");
            }

            var trusteeIds = SecurityEntityService.GetHeadIds(billDemand.AuthorId.Value, billDemand.BudgetId);

            var employees = EmployeeService.GetEmployeesBySecurityTrusteeIdsForNotification(trusteeIds,
                                                                                            billDemand.BudgetId, true);

            SendMailsToEmployee(employees, billDemand, WorkflowState.BillDemandHeadInitiatorSighting);
        }