public void onSuccessUpdateStatus (ResultDTO result, int iStatus) { _activity.RunOnUiThread (() => { progress.Hide(); if(result != null) { if(result.status) { switch(iStatus){ case (int)Constants.STATUS_CONSULTANT.Available: changeStatusDelegate.onSelectedStatus (Constants.STATUS_CONSULTANT.Available); break; case (int)Constants.STATUS_CONSULTANT.MaybeAvailable: changeStatusDelegate.onSelectedStatus (Constants.STATUS_CONSULTANT.MaybeAvailable); break; case (int)Constants.STATUS_CONSULTANT.NotAvailable: changeStatusDelegate.onSelectedStatus (Constants.STATUS_CONSULTANT.NotAvailable); break; } } else { popupNotice.showNoticeDialog(_activity.GetString(Resource.String.availability_title), _activity.GetString(Resource.String.request_fail)); } } else { popupNotice.showNoticeDialog(_activity.GetString(Resource.String.availability_title), _activity.GetString(Resource.String.request_fail)); } }); }
public void onUpdateBookingStatusSuccess (ResultDTO result) { this.RunOnUiThread (() => { llProgress.Visibility = ViewStates.Gone; if(result != null) { if(result.status) { popupNotice.showNoticeDialogToDestroy(GetString(Resource.String.title_notice), GetString(Resource.String.request_success)); } else { if(result.message != null) { popupNotice.showNoticeDialogToDestroy(GetString(Resource.String.title_notice), result.message); } else { popupNotice.showNoticeDialog(GetString(Resource.String.title_notice), GetString(Resource.String.request_fail)); } } } else { popupNotice.showNoticeDialog(GetString(Resource.String.title_notice), GetString(Resource.String.request_fail)); } }); }
public static ResultDTO parseDataChangeStatus (string response) { ResultDTO resultDto = new ResultDTO (); try { Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>> (response); if (result.ContainsKey ("Status")) { resultDto.status = bool.Parse(result ["Status"].ToString()); } if (result.ContainsKey ("Message") && result["Message"] != null && !result["Message"].ToString().Equals("")) { resultDto.message = result["Message"].ToString(); } } catch (Exception ex) { #if DEBUG Console.Write(ex.Message); #endif return null; } return resultDto; }