Example #1
0
        public override string BuildSingleStrategyString(Strategy strategy)
        {
            TaskBudgetStrategyName name = (TaskBudgetStrategyName)strategy.Name;
            string text = "";

            if (strategy.Type == StrategyType.Other)
            {
                switch (name)
                {
                case TaskBudgetStrategyName.WBSCodeEx:
                {
                    string wbsCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(wbsCode, TreeNodeSearchType.AllSubNodeIncludeSelf));

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

                    case "2":
                        return(WBSStrategyBuilder.BuildTreeNodeSearchString(wbsCode, TreeNodeSearchType.AllSubNotLeafNode));
                    }
                    return(text);
                }

                case TaskBudgetStrategyName.CostCode:
                    return(text);

                case TaskBudgetStrategyName.CostCodeEx:
                {
                    string costCode = strategy.GetParameter(0);
                    switch (strategy.GetParameter(1))
                    {
                    case "0":
                        return(CBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.AllSubNodeIncludeSelf));

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

                    case "2":
                        return(CBSStrategyBuilder.BuildTreeNodeSearchString(costCode, TreeNodeSearchType.AllSubNotLeafNode));
                    }
                    return(text);
                }
                }
                return(text);
            }
            return(StandardStrategyStringBuilder.BuildStrategyString(strategy));
        }
Example #2
0
        private void LoadData()
        {
            DAL.QueryStrategy.WBSStrategyBuilder WSB = new RmsPM.DAL.QueryStrategy.WBSStrategyBuilder();
            if ((string)ViewState["ProjectCode"] != "")
            {
                WSB.AddStrategy(new Strategy(DAL.QueryStrategy.WBSStrategyName.ProjectCode, (string)ViewState["ProjectCode"]));
            }
            WSB.AddStrategy(new Strategy(DAL.QueryStrategy.WBSStrategyName.ParentCode, (string)ViewState["SelectCode"]));
            WSB.AddOrder(" PlannedStartDate ", false);
            string     sql    = WSB.BuildMainQueryString();
            QueryAgent QA     = new QueryAgent();
            DataSet    dsTask = QA.ExecSqlForDataSet(sql);

            QA.Dispose();
            this.dgDetailData.DataSource = dsTask;
            this.dgDetailData.DataBind();
        }
Example #3
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));
        }