예제 #1
0
        private void PromptTextASAPList()
        {
            if (!PrefC.GetBool(PrefName.WebSchedAsapEnabled) || Appointments.RefreshASAP(0, 0, _appt.ClinicNum, new List <ApptStatus>()).Count == 0 ||
                !MsgBox.Show("Appointment", MsgBoxButtons.YesNo, "Text patients on the ASAP List and offer them this opening?"))
            {
                return;
            }
            DateTime slotStart = AppointmentL.DateSelected.Date;            //Midnight
            DateTime slotEnd   = AppointmentL.DateSelected.Date.AddDays(1); //Midnight tomorrow
            //Loop through all other appts in the op to find a slot that will not overlap.
            List <Appointment> listApptsInOp = Appointments.GetAppointmentsForOpsByPeriod(new List <long> {
                _appt.Op
            }, _appt.AptDateTime);

            foreach (Appointment otherAppt in listApptsInOp.Where(x => x.AptNum != _appt.AptNum))
            {
                DateTime dateEndApt = otherAppt.AptDateTime.AddMinutes(otherAppt.Pattern.Length * 5);
                if (dateEndApt.Between(slotStart, _appt.AptDateTime))
                {
                    slotStart = dateEndApt;
                }
                if (otherAppt.AptDateTime.Between(_appt.AptDateTime, slotEnd))
                {
                    slotEnd = otherAppt.AptDateTime;
                }
            }
            slotStart = ODMathLib.Max(slotStart, _appt.AptDateTime.AddHours(-1));
            slotEnd   = ODMathLib.Min(slotEnd, _appt.AptDateTime.AddHours(3));
            FormASAP formASAP = new FormASAP(_appt.AptDateTime, slotStart, slotEnd, _appt.Op);

            formASAP.ShowDialog();
        }
예제 #2
0
		private void OnASAPList_Click() {
			Cursor=Cursors.WaitCursor;
			FormASAP FormA=new FormASAP();
			FormA.ShowDialog();
			if(FormA.PinClicked) {
				SendToPinBoard(FormA.AptSelected);
			}
			if(FormA.SelectedPatNum!=0) {
				RefreshModuleDataPatient(FormA.SelectedPatNum);
				OnPatientSelected(PatCur);
				//RefreshModulePatient(FormA.SelectedPatNum);
			}
			Cursor=Cursors.Default;
		}