/** * ejecutar proceso de validacion del folio */ async void Submit_Tapped(System.Object sender, System.EventArgs e) { // verificamos si el folio cumple con lo minimo para ser enviado if (!await VerifyFolio()) { return; } // obtenemos el folio del textField. string Folio = FolioField.Text; // mostramos el loading. Loading(true); //string FolioLogin = string.Format("{0}_{1}", Settings.sUsuarioUID, Folio); string UserRequest = Settings.sUsuarioUID; // solicitamos un medico disponible. ResponseModel model = await cpFeedService.m_SolicitaMedico(UserRequest, Folio); if (!string.IsNullOrEmpty(model.sParameter1)) { if (_resultCompletion != null) { _resultCompletion.SetResult( FolioResult.Done(Message: model.sMensaje, SessionId: model.sParameter1, Folio: model.sFolio)); _resultCompletion = null; } } else { Loading(false); await DisplayAlert("Info", model.sMensaje, "Aceptar"); } }
public async Task ExecuteCommand(string psComand) { if (!await oInternetService.VerificaInternet()) { return; } switch (psComand) { case "CHAT": newResponseModel <medicSpecialityDTO> oResponseModel = new newResponseModel <medicSpecialityDTO>(); oResponseModel = await cpFeeds.m_SolicitaMedico(Settings.bEsAgendada, Settings.iIdUsuario, Settings.dtFechaVencimiento); if (oResponseModel.Code != 0 && oResponseModel.Result.iNumSala != "0") { if (await VerificaPermisosAudio()) { //Multimedia.Context.Instance.SessionId = oResponseModel.sParameter1; Multimedia.Context.Instance.SessionId = oResponseModel.Result.iNumSala; Multimedia.Context.Instance.Name = Settings.sUserName; Multimedia.Context.Instance.IsMedicConnected = false; Multimedia.Context.Instance.EnableScreenShare = false; Multimedia.Context.Instance.EnableAudioReceive = false; Multimedia.Context.Instance.EnableAudioSend = false; Multimedia.Context.Instance.EnableVideoReceive = false; Multimedia.Context.Instance.EnableVideoSend = false; await Navigation.PushModalAsync(new Chat(false)); } } else { await DisplayAlert("Info", oResponseModel.Message, "Aceptar"); if (PopupNavigation.PopupStack.Count > 0) { await PopupNavigation.Instance.PopAsync(); } } isVideoCall = false; break; case "VIDEOCALL": if (isVideoCall) { return; } isVideoCall = true; if (!await VerificaPermisosAudio()) { return; } await PopupNavigation.Instance.PushAsync(_loginPopup); newResponseModel <medicSpecialityDTO> oResponseModel_Video = new newResponseModel <medicSpecialityDTO>(); oResponseModel_Video = await cpFeeds.m_SolicitaMedico(Settings.bEsAgendada, Settings.iIdUsuario, Settings.dtFechaVencimiento); if (oResponseModel_Video.Code == 0 && oResponseModel_Video.Result.iNumSala != "0") { string folio = Settings.sFolio; // string.IsNullOrEmpty(Settings.COVIDFolio) ? Settings.sFolio : Settings.COVIDFolio; //Multimedia.Context.Instance.SessionId = oResponseModel_Video.sParameter1; Multimedia.Context.Instance.SessionId = oResponseModel_Video.Result.iNumSala; Multimedia.Context.Instance.Name = Settings.sUserName + "(" + folio + ")"; Multimedia.Context.Instance.IsMedicConnected = false; Multimedia.Context.Instance.Videollamada_init = false; Multimedia.Context.Instance.EnableScreenShare = false; Multimedia.Context.Instance.EnableAudioReceive = true; Multimedia.Context.Instance.EnableAudioSend = true; Multimedia.Context.Instance.EnableVideoReceive = true; Multimedia.Context.Instance.EnableVideoSend = true; await Navigation.PushAsync(new Chat(true) { Title = "Folio: " + folio, BarBackgroundColor = Color.FromHex("#FFFFFF") }); } else { await DisplayAlert("Info", oResponseModel_Video.Message, "Aceptar"); if (PopupNavigation.Instance.PopupStack.Count > 0) { await PopupNavigation.Instance.PopAsync(); } } isVideoCall = false; break; case "CALL": Settings.bPoPupActivo = true; if (!string.IsNullOrEmpty(Settings.sTelefonoDRs)) { Settings.sError = ""; Device.OpenUri(new Uri("tel:" + Settings.sTelefonoDRs + "")); Settings.bPoPupActivo = false; } else { Settings.bPoPupActivo = false; await DisplayAlert("Llamada", "Por el momento no hay servicio de llamadas, cierre sesiĆ³n e intente nuevamente.", "Aceptar"); } Settings.bEnProceso = false; break; } }