public static bool updateAccount(String display, String bio) { Util.Response vResponse = Util.request(new Util.Request { METHOD = Method.PATCH, TARGET = "account", DATA = new { DISPLAY_NAME = display, BIO = bio } }); if (vResponse.success.ToLower() == "true") { return(true); } else { return(false); } }
public CreateOrganization() { Title = "Create Organization"; Content = new StackLayout() { Padding = 10, Children = { (NAME = new Entry { Placeholder = "Placeholder Name" }), (USERNAME = new Entry { Placeholder = "Placeholder Username" }), (TYPE = new Picker { Title = "Organization Type", Items = { "Organization", "School" } }), new Label { Text = "Organization Description" }, (DESCRIPTION = new Editor { HeightRequest = 100, Text = "" }), new Button { BackgroundColor = Color.FromHex("#3498DB"), BorderRadius = 0, TextColor = Color.White, Text = "Join", HeightRequest = 50, Command = new Command((obj) => { Util.Response vResponse = Util.request(new Util.Request { METHOD = Method.POST, TARGET = "organization", DATA = new { NAME= NAME.Text, DESCRIPTION = DESCRIPTION.Text, TYPE = TYPE.SelectedIndex, USERNAME = USERNAME.Text } }); if (vResponse.success.ToLower() == "true") { OrgS response = JsonConvert.DeserializeObject <OrgS>(vResponse.raw); DisplayAlert("Organization Create", "" + response.data.id, "Nice!"); } else { DisplayAlert("Organization NOT CREATED", vResponse.raw, "!"); } }) } } }; }