Beispiel #1
0
 private void CheckDemandAdjustmentLimits(DemandAdjustment da)
 {
     if (da.TargetDemand == null || da.SourceDemand == null || da.TargetDemand.Limit == null || da.SourceDemand.Limit == null)
     {
         throw new InvalidOperationException("В корректировке не заполнениы заявки и/или лимиты в этих заявках");
     }
 }
Beispiel #2
0
        private bool CheckToSkipUPKZSighting(DemandAdjustment da)
        {
            if (SecurityEntityService.CheckTrusteeWithIdIsInRole(da.CreatorId, BudgetRole.Curator) ||
                SecurityEntityService.CheckTrusteeWithIdIsInRole(da.CreatorId, BudgetRole.UPKZHead))
            {
                return(true);
            }

            return(false);
        }
Beispiel #3
0
 private bool CheckToSkipTargetDemandLimitManagerSighting(DemandAdjustment da)
 {
     try
     {
         CheckDemandAdjustmentLimits(da);
     }
     catch (InvalidOperationException)
     {
         return(false);
     }
     return((da.TargetDemand.Limit.ExecutorId == da.SourceDemand.Limit.ExecutorId && da.TargetDemand.Limit.ManagerId == da.SourceDemand.Limit.ManagerId) || (da.TargetDemand.Limit.ExecutorId == da.TargetDemand.Limit.ManagerId));
 }
Beispiel #4
0
 private bool CheckLimitIsContingency(DemandAdjustment demandAdjustment)
 {
     return((demandAdjustment.SourceDemandId.HasValue && demandAdjustment.SourceDemand.Limit != null && demandAdjustment.SourceDemand.Limit.TypeId == 1) ||
            (demandAdjustment.TargetDemandId.HasValue && demandAdjustment.TargetDemand.Limit != null && demandAdjustment.TargetDemand.Limit.TypeId == 1));
 }