Пример #1
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            var           signature        = Utility.GetMD5(Utility.GetCustomConfig("APP_SALSA") + Utility.JsonSerialize_IgnoreLoopingReference(DTO.GetSignatureDTO()));
            dynamic       validationResult = new ExpandoObject();
            List <string> FrqValues        = new List <string>();

            PxStat.RequestLanguage.LngIsoCode = DTO.LngIsoCode;

            bool isValid = false;


            isValid = Validate();

            // }


            if (isValid)
            {
                validationResult.Signature         = signature;
                validationResult.FrqValueCandidate = FrqValues;
                Response.data = validationResult;



                return(true);
            }
            if (!isValid)
            {
                if (MatrixData != null)
                {
                    if (MatrixData.MainSpec.requiresResponse)
                    {
                        //cancel any validation errors and return an object to enable the user to choose which should be the time dimension
                        Matrix.Specification langSpec = MatrixData.GetSpecFromLanguage(DTO.LngIsoCode);
                        if (langSpec == null)
                        {
                            langSpec = MatrixData.MainSpec;
                        }

                        foreach (var v in langSpec.MainValues)
                        {
                            FrqValues.Add(v.Key);
                        }

                        validationResult.Signature         = null;
                        validationResult.FrqValueCandidate = FrqValues;
                        Response.data = validationResult;
                        return(true);
                    }
                }
                Response.data = validationResult;
                return(false);
            }


            //Response.error = Label.Get("error.validation");
            return(false);
        }