예제 #1
0
 public void AddUsers(List <ParticipantList> participantList)
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         IsBusy = true;
         AddParticipant partData = new AddParticipant();
         partData.CourseId            = this._CourseId;
         partData.ParticipantListData = participantList;
         ReportHandler.GetAddParticipantList(partData,
                                             (response) => {
             Debug.WriteLine("success:" + response.ResponseCode);
             NavigationHandler.GlobalNavigator.Navigation.PopAsync();
             IsBusy = false;
         },
                                             (errorResponse) => {
             //Debug.WriteLine ("Error:: /nCode: " + errorResponse.ResponseCode + "/nMessage: " + errorResponse.Status);
             NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
             IsBusy = false;
         }
                                             );
     }
     else
     {
         NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
     }
 }
예제 #2
0
        public static async Task GetAddParticipantList(AddParticipant addParticipant, Action <AddParticipantResponse> successCallback, Action <ResponseBase> errorCallback)
        {
            RestRequest request = new RestRequest("/lms/api/addparticipant", Method.PUT);

            request.AddBody(new AddParticipantRequest {
                UniqueAppId        = App.UniqueAppId,
                AddParticipantInfo = addParticipant
            });
            AddParticipantResponse response = await APIServiceProvider.ServiceProvider.Execute <AddParticipantResponse> (request);

            if ((response != null) && (response.ResponseCode == "1000"))
            {
                successCallback?.Invoke(response);
            }
            else
            {
                errorCallback?.Invoke((ResponseBase)response);
            }
        }