Example #1
0
        private void butChange_Click(object sender, System.EventArgs e)
        {
            FormPatientSelect FormPS = new FormPatientSelect();

            FormPS.SelectionModeOnly = true;
            FormPS.ShowDialog();
            if (FormPS.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (Cur.ObjectType == TaskObjectType.Patient)
            {
                Cur.KeyNum = FormPS.SelectedPatNum;
            }
            if (Cur.ObjectType == TaskObjectType.Appointment)
            {
                FormApptsOther FormA = new FormApptsOther(FormPS.SelectedPatNum);
                FormA.SelectOnly = true;
                FormA.ShowDialog();
                if (FormA.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
                Cur.KeyNum = FormA.AptSelected;
            }
            FillObject();
        }
Example #2
0
		private void butChange_Click(object sender,System.EventArgs e) {
			FormPatientSelect FormPS=new FormPatientSelect();
			FormPS.SelectionModeOnly=true;
			FormPS.ShowDialog();
			if(FormPS.DialogResult!=DialogResult.OK) {
				return;
			}
			if(TaskCur.ObjectType==TaskObjectType.Patient) {
				TaskCur.KeyNum=FormPS.SelectedPatNum;
			}
			if(TaskCur.ObjectType==TaskObjectType.Appointment) {
				FormApptsOther FormA=new FormApptsOther(FormPS.SelectedPatNum);
				FormA.SelectOnly=true;
				FormA.ShowDialog();
				if(FormA.DialogResult==DialogResult.Cancel) {
					return;
				}
				TaskCur.KeyNum=FormA.AptNumsSelected[0];
			}
			FillObject();
		}
Example #3
0
		///<summary>Displays the Other Appointments for the current patient, then refreshes screen as needed.  initialClick specifies whether the user doubleclicked on a blank time to get to this dialog.</summary>
		private void DisplayOtherDlg(bool initialClick) {
			if(PatCur==null) {
				return;
			}
			FormApptsOther FormAO=new FormApptsOther(PatCur.PatNum);
			FormAO.InitialClick=initialClick;
			FormAO.ShowDialog();
			if(FormAO.OResult==OtherResult.Cancel) {
				return;
			}
			switch(FormAO.OResult) {
				case OtherResult.CopyToPinBoard:
					SendToPinBoard(FormAO.AptNumsSelected);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
				case OtherResult.NewToPinBoard:
					SendToPinBoard(FormAO.AptNumsSelected);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
				case OtherResult.PinboardAndSearch:
					SendToPinBoard(FormAO.AptNumsSelected);
					if(ApptDrawing.IsWeeklyView) {
						break;
					}
					dateSearch.Text=FormAO.DateJumpToString;
					if(!groupSearch.Visible) {//if search not already visible
						ShowSearch();
					}
					DoSearch();
					break;
				case OtherResult.CreateNew:
					ContrApptSingle.SelectedAptNum=FormAO.AptNumsSelected[0];
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					Appointment apt=Appointments.GetOneApt(ContrApptSingle.SelectedAptNum);
					if(apt!=null && DoesOverlap(apt)) {
						Appointment aptOld=apt.Clone();
						MsgBox.Show(this,"Appointment is too long and would overlap another appointment.  Automatically shortened to fit.");
						while(DoesOverlap(apt)) {
							apt.Pattern=apt.Pattern.Substring(0,apt.Pattern.Length-1);
							if(apt.Pattern.Length==1) {
								break;
							}
						}
						try {
							Appointments.Update(apt,aptOld);
						}
						catch(ApplicationException ex) {
							MessageBox.Show(ex.Message);
						}
					}
					RefreshPeriod();
					SetInvalid();
					break;
				case OtherResult.GoTo:
					ContrApptSingle.SelectedAptNum=FormAO.AptNumsSelected[0];
					AppointmentL.DateSelected=PIn.Date(FormAO.DateJumpToString);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
			}
		}
Example #4
0
		///<summary>Displays the Other Appointments for the current patient, then refreshes screen as needed.  initialClick specifies whether the user doubleclicked on a blank time to get to this dialog.</summary>
		private void DisplayOtherDlg(bool initialClick) {
			if(PatCur==null) {
				return;
			}
			FormApptsOther FormAO=new FormApptsOther(PatCur.PatNum);
			FormAO.InitialClick=initialClick;
			FormAO.ShowDialog();
			if(FormAO.OResult==OtherResult.Cancel) {
				return;
			}
			switch(FormAO.OResult) {
				case OtherResult.CopyToPinBoard:
					SendToPinBoard(FormAO.AptNumsSelected);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
				case OtherResult.NewToPinBoard:
					SendToPinBoard(FormAO.AptNumsSelected);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
				case OtherResult.PinboardAndSearch:
					SendToPinBoard(FormAO.AptNumsSelected);
					if(ApptDrawing.IsWeeklyView) {
						break;
					}
					dateSearch.Text=FormAO.DateJumpToString;
					if(!groupSearch.Visible) {//if search not already visible
						ShowSearch();
					}
					DoSearch();
					break;
				case OtherResult.CreateNew:
					ContrApptSingle.SelectedAptNum=FormAO.AptNumsSelected[0];
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					Appointment apt=Appointments.GetOneApt(ContrApptSingle.SelectedAptNum);
					if(apt!=null && !HasValidStartTime(apt)) {
						Appointment aptOld=apt.Clone();
						MsgBox.Show(this,"Appointment start time would overlap another appointment.  Moving appointment to pinboard.");
						SendToPinBoard(apt.AptNum);
						apt.AptStatus=ApptStatus.UnschedList;
						try {
							Appointments.Update(apt,aptOld);
						}
						catch(ApplicationException ex) {
							MessageBox.Show(ex.Message);
						}
						RefreshPeriod();
						break;
					}
					if(apt!=null && DoesOverlap(apt)) {
						Appointment aptOld=apt.Clone();
						MsgBox.Show(this,"Appointment is too long and would overlap another appointment.  Automatically shortened to fit.");
						while(DoesOverlap(apt)) {
							apt.Pattern=apt.Pattern.Substring(0,apt.Pattern.Length-1);
							if(apt.Pattern.Length==1) {
								break;
							}
						}
						try {
							Appointments.Update(apt,aptOld);
						}
						catch(ApplicationException ex) {
							MessageBox.Show(ex.Message);
						}
					}
					RefreshPeriod();
					SetInvalid();
					break;
				case OtherResult.GoTo:
					ContrApptSingle.SelectedAptNum=FormAO.AptNumsSelected[0];
					AppointmentL.DateSelected=PIn.Date(FormAO.DateJumpToString);
					RefreshModuleDataPatient(FormAO.SelectedPatNum);
					OnPatientSelected(PatCur);
					if(ApptDrawing.IsWeeklyView) {
						if((int)AppointmentL.DateSelected.DayOfWeek==0) {//if sunday
							WeekStartDate=AppointmentL.DateSelected.AddDays(-6).Date;//go back to the previous monday
						}
						else {
							WeekStartDate=AppointmentL.DateSelected.AddDays(1-(int)AppointmentL.DateSelected.DayOfWeek).Date;//go back to current monday
						}
						WeekEndDate=WeekStartDate.AddDays(ApptDrawing.NumOfWeekDaysToDisplay-1).Date;
					}
					//RefreshModulePatient(FormAO.SelectedPatNum);
					RefreshPeriod();
					break;
			}
		}