private void CheckOnInputUpkzHeadSighting(BillDemand billDemand) { if (!SecurityEntityService.CheckThatSomebodyHasRole(BudgetRole.UPKZHead)) { EmailService.SendEmail("BD_NOT_FOUND_UPKZ_HEAD", GetDefaultParameters(billDemand)); } }
private void CheckOnInputUpkzControllerSighting(BillDemand billDemand) { if (!SecurityEntityService.CheckThatSomebodyHasRole(BudgetRole.Controller)) { EmailService.SendEmail("BD_NOT_FOUND_UPKZ_CONTROLLER", GetDefaultParameters(billDemand)); } }
private void SendOnUPKZHeadSighting(Demand demand) { if (!demand.InitiatorStructId.HasValue) { return; } var employees = SecurityEntityService.GetAllEmployeesInRole(BudgetRole.UPKZHead, demand.BudgetVersion.BudgetId, true); SendMailsToEmployee(employees, demand, WorkflowState.DemandUPKZHeadSighting); }
private void SendOnRollbackRequested(Demand demand) { if (!demand.InitiatorStructId.HasValue) { return; } var employees = SecurityEntityService.GetAllEmployeesInRole(BudgetRole.Curator, demand.BudgetVersion.BudgetId, true); SendMailsToEmployee(employees, demand, WorkflowState.DemandRollbackRequested); }
private bool CheckToSkipUPKZSighting(DemandAdjustment da) { if (SecurityEntityService.CheckTrusteeWithIdIsInRole(da.CreatorId, BudgetRole.Curator) || SecurityEntityService.CheckTrusteeWithIdIsInRole(da.CreatorId, BudgetRole.UPKZHead)) { return(true); } return(false); }
//private void SendOnAgreementOPHeadSighting(Demand demand) //{ // if (!demand.AgreementCfo.HasValue) // return; // var identityIds = EmployeeService.GetAllTrusteeInStructDivisionIds(demand.AgreementCfo.Value); // var employees = SecurityEntityService.GetAllEmployeesInRole(identityIds, BudgetRole.DivisionHead, demand.BudgetVersion.BudgetId, true); // SendMailsToEmployee(employees, demand, WorkflowState.DemandAgreementOPHeadSighting); //} private void SendOnOPExpertSighting(Demand demand) { if (!demand.ExecutorStructId.HasValue) { return; } var identityIds = EmployeeService.GetAllTrusteeInStructDivisionIds(demand.ExecutorStructId.Value); var employees = SecurityEntityService.GetAllEmployeesInRole(identityIds, BudgetRole.Expert, demand.BudgetVersion.BudgetId, true); SendMailsToEmployee(employees, demand, WorkflowState.DemandOPExpertSighting); }
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); }
public bool CheckInitiatorIsHead(Guid billDemandUid) { using (var scope = ReadCommittedSupressedScope) { using (var context = this.CreateContext()) { var billDemand = GetBillDemand(context, billDemandUid); return(billDemand.AuthorId.HasValue && (SecurityEntityService.CheckTrusteeWithIdIsInRole(billDemand.AuthorId.Value, BudgetRole.DivisionHead))); } } }