Exemplo n.º 1
0
        public FormMetadata GetFormMetadataAsync(string form)
        {
            FormMetadata formMetadata;

            if (this.AllFormsMetadata != null)
            {
                formMetadata = this.AllFormsMetadata[form];
            }
            else if (this.UiMetadataWebApi != null)
            {
                formMetadata = UiMetadataHttpRequestHelper.GetFormMetadata(form, this.UiMetadataWebApi.FormMetadataUrl,
                                                                           this.UserDefaults.StringForKey("Cookies")).Result;
            }
            else
            {
                formMetadata = this.FormRegister.GetFormInfo(form)?.Metadata;
            }

            if (formMetadata == null)
            {
                this.ShowToast("Error fetching data. Server returned status code: {0}");
                return(null);
            }
            return(formMetadata);
        }
Exemplo n.º 2
0
        public async Task <List <InvokeForm.Response> > InvokeFormAsync(object param, bool setCookies = true)
        {
            var response = await UiMetadataHttpRequestHelper.InvokeForm(this.UiMetadataWebApi.RunFormUrl, this.UserDefaults.StringForKey("Cookies"),
                                                                        param);

            this.UserDefaults.SetString(response.Cookies, "Cookies");

            if (response.Response == null)
            {
                this.ShowToast("Error fetching data. Server returned status code: {0}");
                return(null);
            }
            return(response.Response);
        }