Пример #1
0
        public override string Fetch(DataRow dr)
        {
            Initialize(dr, true, new SPMConfig()
            {
                AcceptAllCertificatePolicy = true, Expect100Continue = false
            });
            string message = String.Empty;
            string output  = String.Empty;

            Result <string> fields = Validate();

            if (fields.IsValid)
            {
                Result <IRestResponse> response = GetResponse(dr["orgName"].ToString());

                if (response.IsValid)
                {
                    WebParse        webParse    = new WebParse();
                    Result <string> parseResult = webParse.Execute(response.Value);

                    if (parseResult.IsValid)
                    {
                        HandleModes(response.Value.Content, webParse);

                        output = parseResult.Value;
                    }
                    else
                    {
                        message = parseResult.Message;
                    }
                }
                else
                {
                    message = response.Message;
                }
            }
            else
            {
                message = fields.Message;
            }

            return(ProcessResults(output, message));
        }