public async Task <IActionResult> PostTodoItem(ClientAppointment item) { _context.ClientAppointments.Add(item); await _context.SaveChangesAsync(); return(StatusCode(201)); }
public PostAndPutAppointmentDialog(ClientAppointment app) { Statuses = new List <string>() { "Proposed", "Pending", "Booked", "Arrived", "Fulfilled", "CheckedIn", "Waitlist", "Noshow", "EnteredInError" }; thisAppointment = app; //clientAppointmentViewModel = new ClientAppointmentViewModel(); aPIServices = new APIServices(); this.InitializeComponent(); }
public async Task <IActionResult> PutTodoItem(long id, ClientAppointment item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
private void ShowProgressNote(int clientId, int noteId = 0) { ProgressNoteInformation clientProgressNote = null; // Create a note object if (noteId == 0) { // Create a new note object clientProgressNote = new ProgressNoteInformation { ClientId = clientId }; ClientAppointment lastAppointment = ClientAppointment.GetLastAppointmentForClient(clientId); if (lastAppointment != null) { clientProgressNote.DateOfService = lastAppointment.StartTime.Date; clientProgressNote.TimeStarted = lastAppointment.StartTime; clientProgressNote.TimeEnded = lastAppointment.EndTime; } } else { clientProgressNote = ProgressNoteInformation.ReturnClientProgressNote(noteId); } // Create the progress note form ProgressNoteForm progressForm = new ProgressNoteForm { MainFormObject = this, CurrentProgressNote = clientProgressNote }; // Pass in the note if (noteId > 0) { progressForm.EditMode = true; } // Show the screen DialogResult dlgResult = progressForm.ShowDialog(); // Refresh the list FillClientTreeView(); // If we deleted what we had selected, select the first item in the list if (dlgResult == DialogResult.Abort) { treeViewClients.SelectedNode = treeViewClients.Nodes[0].Nodes[0]; } }
public async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "appointment-manager")] HttpRequest req, [DurableClient] IDurableClient durableClient, ILogger log) { var clientAppointment = new ClientAppointment { ClientId = Guid.NewGuid(), AppointmentId = Guid.NewGuid(), PhoneNumber = "+00011112222" }; string instanceId = await durableClient.StartNewAsync(nameof(AppointmentSchedulingOrchestrator), clientAppointment); return(durableClient.CreateCheckStatusResponse(req, instanceId)); }
/// <summary> /// Hämtar alla bokningar från FHIR-servern /// </summary> /// <returns><ObservableCollection<ClientAppointment></returns> public async Task <ObservableCollection <ClientAppointment> > GetAllAppointmentAsync() { var jsonGetAllAppointments = await httpClient.GetStringAsync(AppointmentsUrl); ObservableCollection <ClientAppointment> retVal = new ObservableCollection <ClientAppointment>(); FhirJsonParser fjp = new FhirJsonParser(); Bundle bund = fjp.Parse <Bundle>(jsonGetAllAppointments); if (null != bund) { foreach (var entry in bund.Entry) { ClientAppointment newApp = new ClientAppointment(entry.Resource as Appointment); retVal.Add(newApp); } } return(retVal); }
/// <summary> /// Ändrar en bokning i FHIR-servern /// </summary> /// <param name="app"></param> /// <returns>Appointment</returns> public async Task <Appointment> PutAppointmentAsync(ClientAppointment app) { using (HttpClient client = new HttpClient()) { var serializer = new FhirJsonSerializer(); var JsonAppointment = serializer.SerializeToString(app.Appointment); //var appointment = JsonConvert.SerializeObject(app); HttpContent httpContent = new StringContent(JsonAppointment); httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var result = await client.PutAsync(AppointmentsUrl + "/" + app.Appointment.Id.ToString(), httpContent); string p = await result.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <Appointment>(p)); } }
private void schedulerStorageMain_AppointmentsChanged(object sender, PersistentObjectsEventArgs e) { foreach (Appointment schedAppointment in e.Objects) { ClientAppointment clientAppt = MapToClientAppointment(schedAppointment); if (clientAppt != null) { if (clientAppt.Id == 0) { clientAppt.Insert(); } else { clientAppt.Update(); } } } }
private void InitAppointments() { AppointmentMappingInfo mappings = schedulerStorageMain.Appointments.Mappings; mappings.AppointmentId = "Id"; mappings.Start = "StartTime"; mappings.End = "EndTime"; mappings.Subject = "Subject"; mappings.AllDay = "AllDay"; mappings.Description = "Description"; mappings.Label = "Label"; mappings.Location = "Location"; mappings.RecurrenceInfo = "RecurrenceInfo"; mappings.ReminderInfo = "ReminderInfo"; mappings.ResourceId = "ResourceId"; mappings.Status = "Status"; mappings.Type = "EventType"; // add in the client Id field schedulerStorageMain.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("ClientId", "ClientId")); // fills in the appointments from the database schedulerStorageMain.Appointments.DataSource = ClientAppointment.GetClientAppointments(); }
private ClientAppointment MapToClientAppointment(Appointment apt) { ClientAppointment newAppointment = new ClientAppointment(); if (apt.Id == null) { newAppointment.Id = 0; } else { newAppointment.Id = (int)apt.Id; } newAppointment.ClientId = (int)apt.CustomFields["ClientId"]; newAppointment.Description = apt.Description; newAppointment.StartTime = apt.Start; newAppointment.EndTime = apt.End; newAppointment.Subject = apt.Subject; newAppointment.AllDay = apt.AllDay; newAppointment.Location = apt.Location; newAppointment.ResourceId = apt.ResourceId; return(newAppointment); }