public override string BuildSingleStrategyString(Strategy strategy)
        {
            ConstructPlanStepStrategyName name = (ConstructPlanStepStrategyName)strategy.Name;
            string text      = "";
            string parameter = "";
            string text3     = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case ConstructPlanStepStrategyName.VisualProgressIn:
                    text3 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text3 != "")
                    {
                        text = string.Format(" VisualProgress in ({0}) ", text3);
                    }
                    return(text);

                case ConstructPlanStepStrategyName.VisualProgressNotIn:
                    text3 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text3 != "")
                    {
                        text = string.Format(" VisualProgress not in ({0}) ", text3);
                    }
                    return(text);

                case ConstructPlanStepStrategyName.ProjectCode:
                    parameter = strategy.GetParameter(0);
                    return(string.Format(" exists(select * from PBSUnit where PBSUnitCode = a.PBSUnitCode and ProjectCode = '{0}') ", parameter));
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            ConstructAnnualPlanStrategyName name = (ConstructAnnualPlanStrategyName)strategy.Name;
            string text  = "";
            string text3 = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case ConstructAnnualPlanStrategyName.VisualProgressIn:
                    text3 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text3 != "")
                    {
                        text = string.Format(" VisualProgress in ({0}) ", text3);
                    }
                    return(text);

                case ConstructAnnualPlanStrategyName.VisualProgressNotIn:
                    text3 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text3 != "")
                    {
                        text = string.Format(" VisualProgress not in ({0}) ", text3);
                    }
                    return(text);
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
Exemple #3
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            CostBudgetContractStrategyName name = (CostBudgetContractStrategyName)strategy.Name;
            string text2 = "";
            string text3 = "";

            if (strategy.Type == StrategyType.Other)
            {
                CostBudgetContractStrategyName name2 = name;
                if (name2 != CostBudgetContractStrategyName.False)
                {
                    if (name2 != CostBudgetContractStrategyName.CostCodeIn)
                    {
                        return(text3);
                    }
                }
                else
                {
                    return("1=2");
                }
                text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                if (text2 != "")
                {
                    text3 = string.Format(" CostCode in ({0}) ", text2);
                }
                return(text3);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            TempRoomOutStrategyName name = (TempRoomOutStrategyName)strategy.Name;
            string text2 = "";
            string text3 = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case TempRoomOutStrategyName.CheckState:
                    return(string.Format("isnull(CheckState, 0) = '{0}'", strategy.GetParameter(0)));

                case TempRoomOutStrategyName.InBuildingCode:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format("exists(select * from TempRoomStructure s where s.TempBuildingCode in ({0}) and s.OutListCode = a.OutListCode)", text2);
                    }
                    return(text3);

                case TempRoomOutStrategyName.InBuildingName:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format("exists(select * from Building b, TempRoomStructure s where b.BuildingName in ({0}) and s.OutListCode = a.OutListCode and b.BuildingCode = s.TempBuildingCode)", text2);
                    }
                    return(text3);

                case TempRoomOutStrategyName.InChamberName:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format("exists(select * from Chamber c, TempRoomStructure s where c.ChamberName in ({0}) and s.OutListCode = a.OutListCode and c.ChamberCode = s.TempChamberCode)", text2);
                    }
                    return(text3);

                case TempRoomOutStrategyName.InRoomName:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format("exists(select * from Room r, TempRoomStructure s where r.RoomName in ({0}) and s.OutListCode = a.OutListCode and r.RoomCode = s.TempRoomCode)", text2);
                    }
                    return(text3);

                case TempRoomOutStrategyName.InRoomCode:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format("exists(select * from TempRoomStructure s where s.TempRoomCode in ({0}) and s.OutListCode = a.OutListCode)", text2);
                    }
                    return(text3);
                }
                return(text3);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
Exemple #5
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            CostBudgetBackupDtlStrategyName name = (CostBudgetBackupDtlStrategyName)strategy.Name;
            string text2 = "";
            string text3 = "";

            if (strategy.Type != StrategyType.Other)
            {
                return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
            }
            CostBudgetBackupDtlStrategyName name2 = name;

            if (name2 != CostBudgetBackupDtlStrategyName.False)
            {
                if (name2 != CostBudgetBackupDtlStrategyName.CostCodeIn)
                {
                    if (name2 != CostBudgetBackupDtlStrategyName.GroupCodeEx)
                    {
                        return(text3);
                    }
                    string systemGroupCode = strategy.GetParameter(0);
                    string parameter       = strategy.GetParameter(1);
                    if (parameter == null)
                    {
                        return(text3);
                    }
                    if (parameter != "0")
                    {
                        if (parameter != "1")
                        {
                            if (parameter != "2")
                            {
                                return(text3);
                            }
                            return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));
                        }
                    }
                    else
                    {
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));
                    }
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));
                }
                text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                if (text2 != "")
                {
                    text3 = string.Format(" CostCode in ({0}) ", text2);
                }
                return(text3);
            }
            return("1=2");
        }
Exemple #6
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            RoomStrategyName name  = (RoomStrategyName)strategy.Name;
            string           text2 = "";
            string           text3 = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case RoomStrategyName.InBuildingCode:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format(" BuildingCode in ({0}) ", text2);
                    }
                    return(text3);

                case RoomStrategyName.OutAspect:
                case RoomStrategyName.InOutAspect:
                    return(text3);

                case RoomStrategyName.InvState:
                    return(string.Format("isnull(InvState,'') ='{0}' ", strategy.GetParameter(0).Trim()));

                case RoomStrategyName.InInvState:
                    text2 = StrategyConvert.BuildInStr(strategy.GetParameter(0));
                    if (text2 != "")
                    {
                        text3 = string.Format(" isnull(InvState, '') in ({0}) ", text2);
                    }
                    return(text3);

                case RoomStrategyName.OutState:
                    return(string.Format("isnull(OutState,'') ='{0}' ", strategy.GetParameter(0).Trim()));

                case RoomStrategyName.SalState:
                    return(string.Format("isnull(SalState,'') ='{0}' ", strategy.GetParameter(0).Trim()));

                case RoomStrategyName.False:
                    return("1=2");

                case RoomStrategyName.PBSTypeCodeAllChild:
                    return(string.Format("(PBSTypeCode = '{0}' or PBSTypeFullID like '{0}-%')", strategy.GetParameter(0).Trim()));

                case RoomStrategyName.OutListCode:
                    return(string.Format("exists(select 1 from TempRoomStructure t where t.TempRoomCode = a.RoomCode and t.OutListCode = '{0}')", strategy.GetParameter(0).Trim()));
                }
                return(text3);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }