/// <summary>Tests the appointment to see if it is acceptable to send it to the pinboard. Also asks user appropriate questions to verify that's /// what they want to do. Returns false if it will not be going to pinboard after all.</summary> public static bool OKtoSendToPinboard(ApptOther AptCur, List <ApptOther> listApptOthers, Control owner) { if (AptCur.AptStatus == ApptStatus.Planned) //if is a Planned appointment { bool PlannedIsSched = false; for (int i = 0; i < listApptOthers.Count; i++) { if (listApptOthers[i].NextAptNum == AptCur.AptNum) //if the planned appointment is already sched { PlannedIsSched = true; } } if (PlannedIsSched) { if (!MsgBox.Show(owner, MsgBoxButtons.OKCancel, "The Planned appointment is already scheduled. Do you wish to continue?")) { return(false); } } } else //if appointment is not Planned { switch (AptCur.AptStatus) { case ApptStatus.Complete: MsgBox.Show(owner, "Not allowed to move a completed appointment from here."); return(false); case ApptStatus.Scheduled: if (!MsgBox.Show(owner, MsgBoxButtons.OKCancel, "Do you really want to move a previously scheduled appointment?")) { return(false); } break; case ApptStatus.Broken: //status gets changed after dragging off pinboard. case ApptStatus.None: case ApptStatus.UnschedList: //status gets changed after dragging off pinboard. break; } } //if it's a planned appointment, the planned appointment will end up on the pinboard. The copy will be made after dragging it off the pinboard. return(true); }
private void butGoTo_Click(object sender, System.EventArgs e) { if (odApptGrid.SelectedApptOther == null) { MsgBox.Show(this, "Please select appointment first."); return; } if (odApptGrid.IsSelectedApptOtherNull()) { return; } ApptOther aptSelected = odApptGrid.SelectedApptOther; if (aptSelected.AptDateTime.Year < 1880) { MsgBox.Show(this, "Unable to go to unscheduled appointment."); return; } ListAptNumsSelected.Add(aptSelected.AptNum); StringDateJumpTo = aptSelected.AptDateTime.Date.ToShortDateString(); _otherResult = OtherResult.GoTo; DialogResult = DialogResult.OK; }
public PinBoardArgs(Patient pat, ApptOther apptOther, List <ApptOther> listApptOthers) { Pat = pat; ApptOther = apptOther; ListApptOthers = listApptOthers; }