Beispiel #1
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");
        }
Beispiel #2
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            CostBudgetMonthStrategyName name = (CostBudgetMonthStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                CostBudgetMonthStrategyName name2 = name;
                if (name2 != CostBudgetMonthStrategyName.False)
                {
                    if (name2 != CostBudgetMonthStrategyName.GroupCodeEx)
                    {
                        return(text);
                    }
                }
                else
                {
                    return("1=2");
                }
                string systemGroupCode = strategy.GetParameter(0);
                string parameter       = strategy.GetParameter(1);
                if (parameter == null)
                {
                    return(text);
                }
                if (parameter != "0")
                {
                    if (parameter != "1")
                    {
                        if (parameter != "2")
                        {
                            return(text);
                        }
                        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")));
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            CostBudgetSetStrategyName name = (CostBudgetSetStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case CostBudgetSetStrategyName.GroupCodeEx:
                {
                    string systemGroupCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));

                    case "1":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));

                    case "2":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));
                    }
                    return(text);
                }

                case CostBudgetSetStrategyName.AccessRange:
                    return(BuildAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1)));

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

                case CostBudgetSetStrategyName.NoTarget:
                    return("not Exists(select * from CostBudget b where isnull(b.TargetFlag, 0) = 1 and b.CostBudgetSetCode = CostBudgetSet.CostBudgetSetCode)");

                case CostBudgetSetStrategyName.NoBudget:
                    return("not Exists(select * from CostBudget b where isnull(b.TargetFlag, 0) = 0 and b.CostBudgetSetCode = CostBudgetSet.CostBudgetSetCode)");
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            CostBudgetStrategyName name = (CostBudgetStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case CostBudgetStrategyName.False:
                    return("1=2");

                case CostBudgetStrategyName.CostBudgetCode:
                    return(text);

                case CostBudgetStrategyName.ExceptCostBudgetCode:
                    return(string.Format("CostBudgetCode <> '{0}'", strategy.GetParameter(0)));

                case CostBudgetStrategyName.GroupCodeEx:
                {
                    string systemGroupCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));

                    case "1":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));

                    case "2":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("CostBudgetSet")));
                    }
                    return(text);
                }

                case CostBudgetStrategyName.AccessRange:
                    return(BuildAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1)));
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
Beispiel #5
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            SupplierStrategyName name = (SupplierStrategyName)strategy.Name;
            string text  = "";
            string text2 = "";

            if (strategy.Type != StrategyType.Other)
            {
                return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
            }
            switch (name)
            {
            case SupplierStrategyName.SupplierTypeCodeEx:
            {
                string systemGroupCode = strategy.GetParameter(0);
                switch (strategy.GetParameter(1))
                {
                case "0":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("Supplier")));

                case "1":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("Supplier")));

                case "2":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("Supplier")));
                }
                return(text);
            }

            case SupplierStrategyName.AccessRange:
                return(AccessRanggeQuery.BuildAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1), strategy.GetParameter(2), SystemClassDescription.GetItemTableName("Supplier"), SystemClassDescription.GetItemKeyColumnName("Supplier"), SystemClassDescription.GetItemTypeColumnName("Supplier"), SystemClassDescription.GetItemCreateUserColumnName("Supplier")));

            case SupplierStrategyName.CheckName:
            {
                string parameter = strategy.GetParameter(0);
                string text4     = strategy.GetParameter(1);
                string text5     = strategy.GetParameter(2);
                if (parameter == "")
                {
                    if (text5 != "")
                    {
                        return(string.Format(" ( SupplierName='{0}'  or  Abbreviation = '{1}' ) ", text4, text5, parameter));
                    }
                    return(string.Format(" ( SupplierName='{0}'   ) ", text4, text5, parameter));
                }
                if (text5 == "")
                {
                    return(string.Format(" ( SupplierCode<>'{2}' )  and ( SupplierName='{0}'   ) ", text4, text5, parameter));
                }
                return(string.Format(" ( SupplierCode<>'{2}' )  and ( SupplierName='{0}'  or  Abbreviation = '{1}' ) ", text4, text5, parameter));
            }

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

            case SupplierStrategyName.IsExistsContract:
                if (strategy.GetParameter(0) != "1")
                {
                    return(" not exists (select * from Contract where Contract.SupplierCode = Supplier.SupplierCode)");
                }
                return(" exists (select * from Contract where Contract.SupplierCode = Supplier.SupplierCode)");

            case SupplierStrategyName.Grade:
                text2 = strategy.GetParameter(0);
                return(string.Format("exists (select * from SupplierSurveyOpinion o where o.SupplierCode = Supplier.SupplierCode and o.SupplierSurveyOpinionCode = (select min(SupplierSurveyOpinionCode) from SupplierSurveyOpinion o2 where o2.SupplierCode = o.SupplierCode) and o.Grade like '{0}')", text2));
            }
            return(text);
        }
Beispiel #6
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            PaymentStrategyName name = (PaymentStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case PaymentStrategyName.WBSCode:
                {
                    string costCode    = strategy.GetParameter(0);
                    string cBSFullCode = CBSDAO.GetCBSFullCode(costCode);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.AllSubNodeIncludeSelf));

                    case "1":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.AllSubLeafNode));

                    case "2":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.AllSubNotLeafNode));

                    case "4":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.OnlySelfNode));
                    }
                    return(text);
                }

                case PaymentStrategyName.AccessRange:
                    return(BuildAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1)));

                case PaymentStrategyName.GroupCode:
                case PaymentStrategyName.PaymentTitle:
                case PaymentStrategyName.PaymentNameEx:
                    return(text);

                case PaymentStrategyName.GroupCodeEx:
                {
                    string systemGroupCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("Payment")));

                    case "1":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("Payment")));

                    case "2":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("Payment")));
                    }
                    return(text);
                }

                case PaymentStrategyName.NotPayout:
                    return("isnull(Money, 0) - isnull(TotalPayoutMoney, 0) >= 0.01");

                case PaymentStrategyName.BatchPayment:
                    return("Payer = '成本批量请款'");

                case PaymentStrategyName.NotBatchPayment:
                    return("isnull(Payer, '') <> '成本批量请款'");
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
Beispiel #7
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            PayoutStrategyName name   = (PayoutStrategyName)strategy.Name;
            string             format = "";

            if (strategy.Type != StrategyType.Other)
            {
                return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
            }
            switch (name)
            {
            case PayoutStrategyName.ContractCode:
                format = "exists (select 1 from V_PayoutItem i where i.PayoutCode = {0}.PayoutCode and i.ContractCode = '{1}')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.ContractID:
                format = "exists (select 1 from V_PayoutItem i where i.PayoutCode = {0}.PayoutCode and i.ContractID like '%{1}%')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.ContractName:
                format = "exists (select 1 from V_PayoutItem i where i.PayoutCode = {0}.PayoutCode and i.ContractName like '%{1}%')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.PaymentCode:
                format = "exists (select 1 from V_PayoutItem i where i.PayoutCode = {0}.PayoutCode and i.PaymentCode = '{1}')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.PaymentID:
                format = "exists (select 1 from V_PayoutItem i where i.PayoutCode = {0}.PayoutCode and i.PaymentID = '{1}')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.VoucherCode:
            case PayoutStrategyName.IsApportioned:
                return(format);

            case PayoutStrategyName.VoucherID:
                format = "exists (select 1 from Voucher v where v.VoucherCode = {0}.VoucherCode and v.VoucherID = '{1}')";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.AccessRange:
                return(AccessRanggeQuery.BuildAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1), strategy.GetParameter(2), SystemClassDescription.GetItemTableName("Payout"), SystemClassDescription.GetItemKeyColumnName("Payout"), SystemClassDescription.GetItemTypeColumnName("Payout"), SystemClassDescription.GetItemCreateUserColumnName("Payout")));

            case PayoutStrategyName.GroupCodeEx:
            {
                string systemGroupCode = strategy.GetParameter(0);
                switch (strategy.GetParameter(1))
                {
                case "0":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("Payout")));

                case "1":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("Payout")));

                case "2":
                    return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("Payout")));
                }
                return(format);
            }

            case PayoutStrategyName.AlloType:
            {
                string parameter = strategy.GetParameter(0);
                string text5     = strategy.GetParameter(1);
                switch (parameter)
                {
                case "P":
                    return(" payoutCode in ( select payoutCode from payoutItem where alloType='P' ) ");

                case "U":
                    return(string.Format(" payoutCode in ( select payoutItem.payoutCode from payoutItem,payoutItemBuilding where payoutItem.PayoutItemCode=PayoutItemBuilding.PayoutItemCode and alloType='U' and PBSUnitCode='{0}'  ) ", text5));
                }
                return(string.Format(" payoutCode in ( select payoutItem.payoutCode from payoutItem,payoutItemBuilding where payoutItem.PayoutItemCode=PayoutItemBuilding.PayoutItemCode and alloType='B' and BuildingCode='{0}'  ) ", text5));
            }

            case PayoutStrategyName.PayoutCodeIN:
                return(string.Format(" payoutcode in ({0}) ", strategy.GetParameter(0)));

            case PayoutStrategyName.IsContract:
                format = "exists (select 1 from PayoutItem i, PaymentItem mi, Payment m where i.PaymentItemCode = mi.PaymentItemCode and mi.PaymentCode = m.PaymentCode and i.PayoutCode = {0}.PayoutCode and m.IsContract = {1})";
                return(string.Format(format, "Payout", strategy.GetParameter(0)));

            case PayoutStrategyName.SubjectCodeStart:
                return(string.Format(" SubjectCode >= '{0}'", strategy.GetParameter(0)));

            case PayoutStrategyName.GreatRootCash:
                return(string.Format("rootCash>={0}", strategy.GetParameter(0)));

            case PayoutStrategyName.SmallRootCash:
                return(string.Format("rootCash<={0}", strategy.GetParameter(0)));

            case PayoutStrategyName.SubjectCodeEnd:
                return(string.Format(" SubjectCode <= '{0}'", strategy.GetParameter(0)));

            case PayoutStrategyName.BatchPayment:
                return("Payer = '成本批量请款'");

            case PayoutStrategyName.NotBatchPayment:
                return("isnull(Payer, '') <> '成本批量请款'");
            }
            return(format);
        }
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            ContractStrategyName name = (ContractStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case ContractStrategyName.TypeEx:
                {
                    string systemGroupCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNodeIncludeSelf, SystemClassDescription.GetItemTypeColumnName("Contract")));

                    case "1":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubLeafNode, SystemClassDescription.GetItemTypeColumnName("Contract")));

                    case "2":
                        return(SystemGroupStrategyBuilder.BuildTreeNodeSearchString(systemGroupCode, TreeNodeSearchType.AllSubNotLeafNode, SystemClassDescription.GetItemTypeColumnName("Contract")));
                    }
                    return(text);
                }

                case ContractStrategyName.Status:
                case ContractStrategyName.TotalMoney:
                case ContractStrategyName.SupplierCode:
                case ContractStrategyName.ContractPerson:
                case ContractStrategyName.ContractDate:
                case ContractStrategyName.CheckDate:
                case ContractStrategyName.ContractLabel:
                case ContractStrategyName.UnitCode:
                    return(text);

                case ContractStrategyName.OriginalContract:
                    return("ContractLabel = ContractCode");

                case ContractStrategyName.NotOriginalContract:
                    return("ContractLabel <> ContractCode");

                case ContractStrategyName.WBSCode:
                    return(string.Format(" ContractCode in ( select ContractCode from TaskContract where WBSCode='{0}' ) ", strategy.GetParameter(0)));

                case ContractStrategyName.AccessRange:
                    return(AccessRanggeQuery.BuildContractAccessRangeString(strategy.GetParameter(0), strategy.GetParameter(1), strategy.GetParameter(2), SystemClassDescription.GetItemTableName("Contract"), SystemClassDescription.GetItemKeyColumnName("Contract"), SystemClassDescription.GetItemTypeColumnName("Contract"), SystemClassDescription.GetItemCreateUserColumnName("Contract")));

                case ContractStrategyName.CostBudgetSetCode:
                    return(string.Format("exists(select 1 from ContractCost left join CBS on CBS.FullCode like '%'+ContractCost.CostCode+'%' where ContractCost.CostBudgetSetCode = '{0}'and ContractCost.ContractCode = Contract.ContractCode)", strategy.GetParameter(0).Trim()));

                case ContractStrategyName.CostCode:
                    return(string.Format("exists(select 1 from ContractCost left join CBS on CBS.FullCode like '%'+ContractCost.CostCode+'%' where ContractCost.CostCode = '{0}'and ContractCost.ContractCode = Contract.ContractCode)", strategy.GetParameter(0).Trim()));

                case ContractStrategyName.FullCode:
                    return(string.Format("exists(select 1 from ContractCost left join CBS on CBS.FullCode like '%'+ContractCost.CostCode+'%' where CBS.FullCode like '{0}'and ContractCost.ContractCode = Contract.ContractCode)", strategy.GetParameter(0).Trim()));

                case ContractStrategyName.SupplierName:
                    return(string.Format("SupplierCode in (select SupplierCode from Supplier where Supplier.SupplierName like '%{0}%')", strategy.GetParameter(0).Trim()));
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }