Пример #1
0
        public virtual async Task <Meeting> GetMeetingAsync(GetMeetingRequestParameter filter)
        {
            IRestRequest postRequest = new RestRequest("data/Search/SearchingMeeting", HttpMethod.POST);

            postRequest.RequestFormat = RequestDataFormat.Json;

            postRequest.AddBody(filter);
            IRestResponse postResponse = await RestClient.ExecuteAsync(postRequest);

            Meeting data = SimpleJson.DeserializeObject <Meeting>(postResponse.Content);

            return(data);
        }
Пример #2
0
        protected async void ExecuteScan(object parameter)
        {
            try
            {
                if (string.IsNullOrEmpty(this.SearchPin) && string.IsNullOrEmpty(this.SearchKey))
                {
                    this.MessagePresenter.Show("Mohon diisi dengan lengkap !");
                }

                else if (!string.IsNullOrEmpty(this.SearchPin) && string.IsNullOrEmpty(this.SearchKey))
                {
                    this.MessagePresenter.Show("Meeting ID harap di isi");
                }

                else if (string.IsNullOrEmpty(this.SearchPin) && !string.IsNullOrEmpty(this.SearchKey))
                {
                    this.MessagePresenter.Show("Meeting Code harap di isi");
                }

                else if (!string.IsNullOrEmpty(this.SearchPin) && !string.IsNullOrEmpty(this.SearchKey))
                {
                    Meeting.MeetingPin = this.SearchPin;
                    Meeting.MeetingKey = this.SearchKey;

                    //RestRepositoryBase<Meeting> RepositoryMeeting = new RestRepositoryBase<Meeting>();
                    //Meeting Meetingin = await RepositoryMeeting.GetMeetingAsync(Meeting);

                    GetMeetingRequestParameter getMeetingRequestParameter = new GetMeetingRequestParameter();
                    getMeetingRequestParameter.MeetingPin = this.SearchPin;
                    getMeetingRequestParameter.MeetingKey = this.SearchKey;

                    Meeting Meetingin = await RestRepository.GetMeetingAsync(getMeetingRequestParameter);

                    if (Meetingin == null)
                    {
                        this.MessagePresenter.Show("Data tidak ditemukan");
                    }
                    else
                    {
                        AppViewModel.Meeting = Meetingin;
                        this.NavigationService.Navigate <MeetingDetailViewModel>(new NavigationParameter());
                    }
                }
            }

            catch (Exception ex)
            {
                this.MessagePresenter.Show(ex.Message);
            }
        }