예제 #1
0
        public ActivityPlan(int topicId, ref System.Array inputStrings, ref string validationString)
        {
            // Set to new request
            this.Updated = false;
            //

            string[] requestStrings = inputStrings.Cast <string>().ToArray();

            // add empty string values to fill out array (let SAP do validation)
            if (requestStrings.Length < m_totalNumberOfParameters)
            {
                List <string> ls = new List <string>(requestStrings);
                while (ls.Count < 15)
                {
                    ls.Add(String.Empty);
                }
                requestStrings = ls.ToArray();
            }


            this.TopicID = topicId;
            this.Hash    = inputStrings.Concatenate();
            //this.FunctionType               =  FunctionType.;

            this.FunctionType          = (PlanningFunctionType)Enum.Parse(typeof(PlanningFunctionType), requestStrings[0]);
            this.m_quantity            = requestStrings[1].ToUpper();             // [TOT_VALUE][ACTVTY_QTY]
            this.m_price               = requestStrings[2].ToUpper();             // [TOT_VALUE][PRICE_FIX]
            this.m_controllingArea     = requestStrings[3].ToUpper();             // [HEADER_INFO][CO_AREA]
            this.m_fiscalYear          = requestStrings[4].ToUpper();             // [HEADER_INFO][FISC_YEAR]
            this.m_perFrom             = requestStrings[5].ToUpper();             // [HEADER_INFO][PERIOD_FROM]
            this.m_perTo               = requestStrings[6].ToUpper();             // [HEADER_INFO][PERIOD_TO]
            this.m_distKey             = requestStrings[7].ToUpper();             // [TOT_VALUE][DIST_KEY_PRICE_FIX]
            this.m_version             = requestStrings[8].ToUpper();             // [HEADER_INFO][VERSION]
            this.m_documentTxt         = requestStrings[9].ToUpper();             // [HEADER_INFO][DOC_HDR_TX]
            this.m_currencyType        = requestStrings[10].ToUpper();            // [HEADER_INFO][PLAN_CURRTYPE]
            this.m_delta               = requestStrings[11].ToUpper();            // [DELTA][DELTA]
            this.m_costCenter          = requestStrings[12].ToUpper();            // [OBJECT][COSTCENTER]
            this.m_activityType        = requestStrings[13].ToUpper();            // [OBJECT][ACTTYPE]
            this.m_transactionCurrency = requestStrings[14].ToUpper();            // [TOT_VALUE][CURRENCY]

            this.Signature = requestStrings[requestStrings.Length - 1].ToUpper();

            IPlanningFunction thisFunc = (IPlanningFunction)this;

            MatManErrorDictionary.GetObject().ValidatePlanningFunction(ref thisFunc, ref validationString);
        }
예제 #2
0
        public CostPlan(int topicId, ref System.Array inputStrings, ref string validationString)
        {
            // Set to new request
            this.Updated = false;
            //

            string[] requestStrings = inputStrings.Cast <string>().ToArray();

            // add empty string values to fill out array (let SAP do validation)
            if (requestStrings.Length < m_totalNumberOfParameters)
            {
                List <string> ls = new List <string>(requestStrings);
                while (ls.Count < m_totalNumberOfParameters)
                {
                    ls.Add(String.Empty);
                }
                requestStrings = ls.ToArray();
            }


            this.TopicID      = topicId;
            this.Hash         = inputStrings.Concatenate();
            this.FunctionType = PlanningFunctionType.CostPlan;

            this.m_fixedInputValue    = requestStrings[1].ToUpper();               // [TOTVALUE][FIX_VALUE]
            this.m_controllingArea    = requestStrings[2].ToUpper();               // [HEADERINFO][CO_AREA]
            this.m_fiscalYear         = requestStrings[3].ToUpper();               // [HEADERINFO][FISC_YEAR]
            this.m_periodFrom         = requestStrings[4].ToUpper();               // [HEADERINFO][PERIOD_FROM]
            this.m_periodTo           = requestStrings[5].ToUpper();               // [HEADERINFO][PERIOD_TO]
            this.m_distributionKey    = requestStrings[6].ToUpper();               // [TOTVALUE][DIST_KEY_FIX_VAL]
            this.m_version            = requestStrings[7].ToUpper();               // [HEADERINFO][VERSION]
            this.m_documentHeaderText = requestStrings[8].ToUpper();               // [HEADERINFO][DOC_HDR_TXT]
            this.m_planningCurrency   = requestStrings[9].ToUpper();               // [HEADERINFO][PLAN_CURRTYPE]
            this.m_delta               = requestStrings[10].ToUpper();             // [DELTA][DELTA]
            this.m_costCenter          = requestStrings[11].ToUpper();             // [COOBJECT][COSTCENTER]
            this.m_costElement         = requestStrings[12].ToUpper();             // [TOTVALUE][COST_ELEM]
            this.m_activityType        = requestStrings[13].ToUpper();             // [COOBJECT][ACTTYPE]
            this.m_orderID             = requestStrings[14].ToUpper();             // [COOBJECT][ORDERID]
            this.m_wbsElement          = requestStrings[15].ToUpper();             // [COOBJECT][WBS_ELEMENT]
            this.m_functionalArea      = requestStrings[16].ToUpper();             // [TOTVALUE][FUNCTION]
            this.m_fund                = requestStrings[17].ToUpper();             // [TOTVALUE][FUND]
            this.m_grant               = requestStrings[18].ToUpper();             // [TOTVALUE][GRANT_NBR]
            this.m_transactionCurrency = requestStrings[19].ToUpper();             // [TOTVALUE][TRANS_CURR]

            this.Signature = requestStrings[requestStrings.Length - 1].ToUpper();

            if (this.m_functionalArea != string.Empty)
            {
                this.m_functionalArea = this.m_functionalArea.TrimStart('0');
                this.m_functionalArea = "000" + this.m_functionalArea;
            }

            if (this.m_wbsElement != string.Empty)
            {
                this.m_wbsElement = this.m_wbsElement.TrimStart(' ');
                if (this.m_wbsElement.ToUpper().StartsWith("WBS"))
                {
                    this.m_wbsElement = this.m_wbsElement.Remove(0, 3);
                }
                this.m_wbsElement = this.m_wbsElement.TrimStart(' ');
            }

            IPlanningFunction thisFunc = (IPlanningFunction)this;

            MatManErrorDictionary.GetObject().ValidatePlanningFunction(ref thisFunc, ref validationString);
        }