public void SoonestAppointment() { atriumDB.AppointmentRow[] apptrs = (atriumDB.AppointmentRow[])FM.DB.Appointment.Select("ShowAsBusy = 1 and StartDateLocal>='" + DateTime.Today.ToString("yyyy/MM/dd") + "'", "StartDateLocal"); if (apptrs.Length > 0) { AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", apptrs[0].ApptId); } else { AppointmentBindingSource.MoveLast(); } }
private void GetOriginalRecurrenceAppointment(FileManager fm) { atriumDB.AppointmentRow apptr = (atriumDB.AppointmentRow)((DataRowView)AppointmentBindingSource.Current).Row; if (!apptr.IsApptRecurrenceIdNull()) { DataRow[] drs = fm.DB.Appointment.Select("ApptRecurrenceId=" + apptr.ApptRecurrenceId.ToString() + " AND OriginalRecurrence='True'"); if (drs.Length > 0) { atriumDB.AppointmentRow origRecurrApptRow = (atriumDB.AppointmentRow)drs[0]; AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", origRecurrApptRow.ApptId); } } }
public override void ReloadUserControlData() { int apptId = 0; if (CurrentRow() != null) { apptId = CurrentRow().ApptId; } AppointmentBindingSource.SuspendBinding(); if (IsOfficerCal) { //must be calendar screen FM.GetAppointment().LoadByContactId(OfficerId); } //else //{ // FM.GetAppointment().LoadByContactId(FM.AtMng.WorkingAsOfficer.OfficerId); //} LoadAttendeeContacts(); //AddRecurrenceSymbol(); AppointmentBindingSource.ResumeBinding(); schedule1.Refetch(); if (IsOfficerCal) { if (apptId == 0) { SoonestAppointment(); } else { int pos = AppointmentBindingSource.Find("ApptId", apptId); if (pos != -1) { AppointmentBindingSource.Position = pos; } else { SoonestAppointment(); } } } else { SoonestAppointment(); } }
private void schedule1_SelectedAppointmentsChanged(object sender, EventArgs e) { try { if (schedule1.CurrentAppointment != null) { int id = (int)schedule1.CurrentAppointment.GetValue("ApptId"); AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", id); // FileTreeView.BuildMenu(FM.AtMng.GetFile(CurrentRow().FileId), cmdHearing, FileTreeView.dmAppt); if (ApptIsHearing()) { FileTreeView.BuildMenu(FM.AtMng.GetFile(CurrentRow().FileId), cmdHearing, FileTreeView.dmHearing); } else { if (CurrentRow() != null) { FileTreeView.BuildMenu(FM.AtMng.GetFile(CurrentRow().FileId), cmdHearing, FileTreeView.dmAppt); } else { CreateAddNewAppointMenu(); } } ToggleApptPnlContents(false); } else { if (CurrentRow() != null) { FileTreeView.BuildMenu(FM.AtMng.GetFile(CurrentRow().FileId), cmdHearing, FileTreeView.dmApptNew); } else { CreateAddNewAppointMenu(); } ToggleApptPnlContents(true); } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdRefreshCal": ReloadUserControlData(); break; case "cmdJumpToFile": JumpToFile(); break; case "tsSave": //Save(); break; case "tsDelete": Delete(); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; case "cmdOneDay": schedule1.View = Janus.Windows.Schedule.ScheduleView.DayView; break; case "cmdWorkWeek": schedule1.View = Janus.Windows.Schedule.ScheduleView.WorkWeek; break; case "cmdWeek": schedule1.View = Janus.Windows.Schedule.ScheduleView.WeekView; break; case "cmdMonth": schedule1.View = Janus.Windows.Schedule.ScheduleView.MonthView; calMonthDisplay.Text = schedule1.Date.ToString("MMMM yyyy"); break; case "cmdGoToToday": schedule1.Date = DateTime.Today; schedule1.View = Janus.Windows.Schedule.ScheduleView.DayView; break; case "cmdGoToNextSevenDays": schedule1.View = Janus.Windows.Schedule.ScheduleView.WeekView; schedule1.Date = DateTime.Today; break; } if (e.Command.Key.StartsWith("tsACMenu")) { ActivityConfig.ACSeriesRow acsr = (ActivityConfig.ACSeriesRow)e.Command.Tag; int apptId; if (acsr.ACSeriesId == FM.AtMng.GetSetting(AppIntSetting.NewApptAcId)) { AddNewAppointment(acsr.ACSeriesId); apptId = FM.DB.Appointment[FM.DB.Appointment.Count - 1].ApptId; } else { apptId = CurrentRow().ApptId; EditReschedule(acsr.ACSeriesId); } if (IsOfficerCal) { ReloadUserControlData(); //find just added or updated appt AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", apptId); } } } catch (Exception x) { UIHelper.HandleUIException(x); } }
public override void MoreInfo(string linkTable, int linkId) { AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", linkId); }