public async Task <ServiceReturn <List <Appointment> > > GetAppointmentByDatesAsync(AuthenticationType tipoAuth, int skip, int take, string successMessage = "", string errorMessage = "") { var uiMessages = new Dictionary <string, string>(); if (!string.IsNullOrEmpty(errorMessage)) { uiMessages.Add(ServiceReturnHandling.GenericMessageKey, errorMessage); } else { uiMessages.Add(ServiceReturnHandling.GenericMessageKey, "Não é possível obter lista de marcações"); } if (!string.IsNullOrEmpty(successMessage)) { uiMessages.Add(ServiceReturnHandling.SuccessMessageKey, successMessage); } try { string baseUrl = await CommunicationManager.ServiceManager.GetServiceEndpoint("GP_BASE_URL"); Generated.AppointmentProcessingClient sc = new Generated.AppointmentProcessingClient(baseUrl, await CommunicationManager.Instance.GetHttpClientWithToken(tipoAuth, new HttpClient())); // Nao existe no cliente AppointmentProcessingClient o GetAppointmentByDates .. usar o ALLAppointments? //var appts = await sc.(null,null, DateTime.Now.AddYears(-3).ToString(), DateTime.Now.AddYears(3).ToString(), skip, take, GetGPAppVersion()); List <Appointment> appts = new List <Appointment>(); foreach (var item in appts) { appts.Add(TranslateAppointmentGPToLocal(null)); } return(ServiceReturnHandling.BuildSuccessCallReturn <List <Appointment> >(appts, uiMessages)); } catch (Exception ex) { return(ServiceReturnHandling.HandleException <List <Appointment> >(ex, uiMessages)); } }
public async Task <ServiceReturn <bool> > RegistryPatientPresenceByCodeAsync(AuthenticationType tipoAuth, string _checkInCode, string successMessage = "", string errorMessage = "") { #region uimessage var uiMessages = new Dictionary <string, string>(); if (!string.IsNullOrEmpty(errorMessage)) { uiMessages.Add(ServiceReturnHandling.GenericMessageKey, errorMessage); } else { uiMessages.Add(ServiceReturnHandling.GenericMessageKey, "Pin inválido. Por favor tente de novo."); } if (!string.IsNullOrEmpty(successMessage)) { uiMessages.Add(ServiceReturnHandling.SuccessMessageKey, successMessage); } #endregion bool CheckedIn = false; try { string baseUrl = await CommunicationManager.ServiceManager.GetServiceEndpoint("GP_BASE_URL"); Generated.AppointmentProcessingClient sc = new Generated.AppointmentProcessingClient(baseUrl, await CommunicationManager.Instance.GetHttpClientWithToken(tipoAuth, new HttpClient())); //TODO nao existe o metodo RegistryPatientPresenceByCode no AppointmentProcessingClient //var result = sc. //GetGPAppVersion(); //CheckedIn = result; return(ServiceReturnHandling.BuildSuccessCallReturn <bool>(CheckedIn, uiMessages)); } catch (Exception ex) { return(ServiceReturnHandling.HandleException <bool>(ex, uiMessages)); } }