internal static AutoReminderAndPlaceHolders getAutoReminderAndPlaceHolders(HttpResponseMessage response) { var reminderAndPlaceHolders = new AutoReminderAndPlaceHolders(); var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("autoreminder")) { var reminder = new AutoReminder(); reminder = JsonConvert.DeserializeObject<AutoReminder>(jsonObj["autoreminder"].ToString()); reminderAndPlaceHolders.autoreminder = reminder; } if (jsonObj.ContainsKey("placeholders")) { var placeHolders = new PlaceHolders(); placeHolders = JsonConvert.DeserializeObject<PlaceHolders>(jsonObj["placeholders"].ToString()); reminderAndPlaceHolders.placeholders = placeHolders; } return reminderAndPlaceHolders; }
internal static ManualReminderAndPlaceHolders getManualReminderAndPlaceHolders(HttpResponseMessage response) { var reminderAndPlaceHolders = new ManualReminderAndPlaceHolders(); var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("manualreminder")) { var reminder = new ManualReminder(); reminder = JsonConvert.DeserializeObject<ManualReminder>(jsonObj["manualreminder"].ToString()); reminderAndPlaceHolders.manualreminder = reminder; } if (jsonObj.ContainsKey("placeholders")) { var placeHolders = new PlaceHolders(); placeHolders = JsonConvert.DeserializeObject<PlaceHolders>(jsonObj["placeholders"].ToString()); reminderAndPlaceHolders.placeholders = placeHolders; } if (jsonObj.ContainsKey("show_org_address_as_one_field")) { reminderAndPlaceHolders.show_org_address_as_one_field = (bool)jsonObj["show_org_address_as_one_field"]; } return reminderAndPlaceHolders; }