Пример #1
0
        protected static bool IsAvailable(Opportunity ths, Sim s, ref string msg)
        {
            msg += Common.NewLine + ths.Guid;

            if (s == null)
            {
                msg += Common.NewLine + " Failure: C";
                return false;
            }
            if (!s.OpportunityManager.CheckRepeatOpportunity(ths.RepeatLevel, ths.Guid))
            {
                msg += Common.NewLine + " Failure: D";
                return false;
            }
            if (ths.IsChildOfOrEqualTo(s.OpportunityManager.GetLastOpportunity(ths.OpportunityCategory)) && !s.SimDescription.OpportunityHistory.HasCurrentOpportunity(ths.OpportunityCategory, ths.Guid))
            {
                msg += Common.NewLine + " Failure: E";
                return false;
            }
            if (!CheckAllRequirements(s, ths, OpportunityNames.Undefined, ref msg))
            {
                return false;
            }
            if (ths.mSharedData.mRequirementDelegate != null)
            {
                if (!ths.mSharedData.mRequirementDelegate(s, ths))
                {
                    msg += Common.NewLine + " Failure: F";
                }
            }
            return true;
        }
Пример #2
0
        protected static bool IsAvailable(Opportunity ths, Sim s, ref string msg)
        {
            msg += Common.NewLine + ths.Guid;

            if (s == null)
            {
                msg += Common.NewLine + " Failure: C";
                return(false);
            }
            if (!s.OpportunityManager.CheckRepeatOpportunity(ths.RepeatLevel, ths.Guid))
            {
                msg += Common.NewLine + " Failure: D";
                return(false);
            }
            if (ths.IsChildOfOrEqualTo(s.OpportunityManager.GetLastOpportunity(ths.OpportunityCategory)) && !s.SimDescription.OpportunityHistory.HasCurrentOpportunity(ths.OpportunityCategory, ths.Guid))
            {
                msg += Common.NewLine + " Failure: E";
                return(false);
            }
            if (!CheckAllRequirements(s, ths, OpportunityNames.Undefined, ref msg))
            {
                return(false);
            }
            if (ths.mSharedData.mRequirementDelegate != null)
            {
                if (!ths.mSharedData.mRequirementDelegate(s, ths))
                {
                    msg += Common.NewLine + " Failure: F";
                }
            }
            return(true);
        }