/// <summary> /// Returns a single StandardAppointment where the id in the request matches the record ID in the database. /// </summary> /// <param name="request">The request used for requesting the record from the database.</param> /// <returns>If FetchLazy was set to false, the JarsStandardAppointment item will be populated, if not then the JarsStandardAppointmentBase record will be filled with data.</returns> public virtual StandardAppointmentsResponse Any(GetStandardAppointment request) { return(ExecuteFaultHandledMethod(() => { StandardAppointmentsResponse response = new StandardAppointmentsResponse(); //IStandardAppointmentRepository _repository = _DataRepositoryFactory.GetDataRepository<IStandardAppointmentRepository>(); var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <StandardAppointment, IDataContextNhJars> >(); response.Appointments.Add(_repository.GetById(request.Id, true).ToStandardAppointmentDto()); return response; })); }
public string PluginText => "StandardAppointmentProcessor";//not really needed, but comes with the plugin.. public async Task LoadOrRefreshEntityDataAsync(bool isRefresh = false) { //StandardAppointmentsResponse saResT = await Context.ServiceClient.GetAsync(new FindStandardAppointments() { FromStartDate = DateTime.Now.AddDays(-3) }); StandardAppointmentsResponse saResT = await Context.ServiceClient.GetAsync(new FindStandardAppointments() { FromStartDate = dateNavigator.SelectionStart }); if (!saResT.IsErrorResponse()) { DataList = saResT.Appointments.ConvertAllTo <StandardAppointment>().ToList();// (a => a.ConvertTo<StandardAppointment>()); } }
/// <summary> /// Find a StandardAppointment by specifying values for the properties available in the request. /// Date values: Start date will go from date forward, end date will be from end date back, and if both has values, /// it will be used as from (between) start to end /// </summary> /// <param name="request">The request used for building the find parameters</param> /// <returns>If LoadLazy was true, then a list of JarsStandardAppointmentBase items, otherwise a list of fully loaded JarsStandardAppointments</returns> public virtual StandardAppointmentsResponse Any(FindStandardAppointments request) { return(ExecuteFaultHandledMethod(() => { StandardAppointmentsResponse response = new StandardAppointmentsResponse(); if (request != null) { var query = BuildQuery <StandardAppointment>(request); //var _repository = _DataRepositoryFactory.GetDataRepository<IStandardAppointmentRepository>(); var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <StandardAppointment, IDataContextNhJars> >(); IList <StandardAppointment> list = _repository.Where(query, true); response.Appointments = list.ToStandardAppointmentDtoList().ToList(); } return response; })); }
/// <summary> /// Update or create a single StandardAppointment or a list of StandardAppointments, depending on whether the StandardAppointment or StandardAppointments property has got a value set. /// If the StandardAppointment property is set the StandardAppointment will be created or updated and the StandardAppointments property will be ignored. /// To create or update more than one StandardAppointment, assign a list to the StandardAppointments property and make sure StandardAppointment is set to nothing/null. /// </summary> /// <param name="request">The request containing the StandardAppointment or StandardAppointments that needs to be created or updated</param> /// <returns>depending on the values supplied, the updated StandardAppointment or StandardAppointments will be returned.</returns> public virtual StandardAppointmentsResponse Any(StoreStandardAppointments request) { //return ExecuteFaultHandledMethod(() => //{ StandardAppointmentsResponse response = new StandardAppointmentsResponse(); //IStandardAppointmentRepository _repository = _DataRepositoryFactory.GetDataRepository<IStandardAppointmentRepository>(); var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <StandardAppointment, IDataContextNhJars> >(); //foreach (var appointment in request.Appointments) //{ // foreach (var apptEx in appointment.StandardAppointmentExceptions) // { // apptEx.StandardAppointment = appointment; // } //} List <StandardAppointment> appts = request.Appointments.FromStandardAppointmentDtoList(); response.Appointments = _repository.CreateUpdateList(appts, CurrentSessionUsername).ToList().ToStandardAppointmentDtoList().ToList(); return(response); //}); }