private void GetThisWeekPrize(string guest_token) { try { this.Loading(true); var api = new ApiAsnycTask(this.Context, GetString(Resource.String.api_url) + "lotto/GetThisWeekPrize", guest_token); var json = api.Execute().Get().ToString(); var _result = JsonConvert.DeserializeObject <ApiResult <NextWeekPrize> >(json); if (_result != null) { var app_cache = new AppPreferences(this.Context); app_cache.NextWeekSequenceNo = _result.result.SequenceNo; last_week_seqno = _result.result.SequenceNo - 1; if (_result.success == true) { week_prize = _result.result; InitNextWeekPrize(rootView, _result.result); } else { AppDialog.SNG.Alert(this.Context, _result.message); } } this.Loading(false); } catch (Java.Lang.Exception ex) { Log.Error(this.GetType().Name, ex.Message); } }
private void GetThisWeekPrizeDic() { try { var appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate; if (String.IsNullOrEmpty(appDelegate.GuestToken) == false) { var responseDict = appDelegate.NetworkInstance.GetThisWeekPrize(appDelegate.GuestToken); ThisWeekPrizeDic = responseDict.result; appDelegate.RecentSeqNum = ThisWeekPrizeDic.SequenceNo; appDelegate.RecentSeqDate = $"{TimeFormatter.GetStringFromDatetime(ThisWeekPrizeDic.IssueDate)}"; } } catch (Exception ex) { ConfigHelper.ShowConfirm("오류", ex.Message, "확인"); } this.myLoadIndicator.StopAnimating(); }
private void InitNextWeekPrize(View view, NextWeekPrize weekPrize) { var tv_predictDate = view.FindViewById <TextView>(Resource.Id.tv_predictDate); var tv_predictSequence = view.FindViewById <TextView>(Resource.Id.tv_predictSequence); var tv_predict = view.FindViewById <TextView>(Resource.Id.tv_predict); var tv_sales = view.FindViewById <TextView>(Resource.Id.tv_sales); var cd_predictDate = AppCommon.SNG.GetDate(weekPrize.IssueDate); { var date = "{0:0000}-{1:00}-{2:00}"; tv_predictDate.SetText(String.Format(date, cd_predictDate.Get(CalendarField.Year), cd_predictDate.Get(CalendarField.Month) + 1, cd_predictDate.Get(CalendarField.DayOfMonth) ) ); } tv_predictSequence.SetText(weekPrize.SequenceNo + "회차"); tv_predict.SetText($"{weekPrize.PredictAmount:#,##0}원"); tv_sales.SetText($"{weekPrize.SalesAmount:#,##0}원"); }