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