private void FormSchedPractice_Load(object sender, System.EventArgs e)
 {
     /*if(PermissionsOld.AuthorizationRequired("Practice Schedule")){
      *      user=Users.Authenticate("Practice Schedule");
      *      if(!UserPermissions.IsAuthorized("Practice Schedule",user)){
      *              MsgBox.Show(this,"You do not have permission for this feature");
      *              DialogResult=DialogResult.Cancel;
      *              return;
      *      }
      * }*/
     if (SchedType == ScheduleType.Practice)
     {
         this.Text         = Lan.g(this, "Practice Schedule");
         labelProv.Visible = false;
         listProv.Visible  = false;
     }
     else if (SchedType == ScheduleType.Provider)
     {
         this.Text = Lan.g(this, "Provider Schedules");
         listProv.Items.Clear();
         for (int i = 0; i < Providers.List.Length; i++)
         {
             listProv.Items.Add(Providers.List[i].Abbr);
         }
         listProv.SelectedIndex = 0;
     }
     SchedDefaults.Refresh();
     OpenColor        = DefB.Long[(int)DefCat.AppointmentColors][0].ItemColor;
     ClosedColor      = DefB.Long[(int)DefCat.AppointmentColors][1].ItemColor;
     HolidayColor     = DefB.Long[(int)DefCat.AppointmentColors][4].ItemColor;
     cal.SelectedDate = DateTime.Today;
     GetScheduleData();
     cal.Invalidate();
 }
Beispiel #2
0
 private void FillGrid()
 {
     SchedDefaults.Refresh();
     contrGrid.SchedType = SchedType;
     if (SchedType == ScheduleType.Provider)
     {
         contrGrid.ProvNum = Providers.List[listProv.SelectedIndex].ProvNum;
     }
     //contrGrid.ArrayBlocks=SchedDefaults.List;
     contrGrid.BackColor = DefB.Long[(int)DefCat.AppointmentColors][1].ItemColor;
     contrGrid.Refresh();
 }
Beispiel #3
0
 ///<summary></summary>
 private static bool Overlaps(SchedDefault sd)
 {
     SchedDefaults.Refresh();
     SchedDefault[] ListForType = SchedDefaults.GetForType(sd.SchedType, sd.ProvNum);
     for (int i = 0; i < ListForType.Length; i++)
     {
         //if(SchedDefaults.List[i].SchedType!=SchedType){
         //	continue;//skip if different sched type
         //}
         //if(SchedDefaults.List[i].SchedType==ScheduleType.Provider
         //	&& SchedDefaults.List[i].ProvNum!=ProvNum)
         //{
         //	continue;//skip if provider type and this is different provider
         //}
         if (ListForType[i].SchedType == ScheduleType.Blockout)
         {
             //skip if blockout, and ops don't interfere
             if (sd.Op != 0 && ListForType[i].Op != 0)                //neither op can be zero, or they will interfere
             {
                 if (sd.Op != ListForType[i].Op)
                 {
                     continue;
                 }
             }
         }
         if (sd.SchedDefaultNum != ListForType[i].SchedDefaultNum &&
             sd.DayOfWeek == ListForType[i].DayOfWeek &&
             sd.StartTime.TimeOfDay >= ListForType[i].StartTime.TimeOfDay &&
             sd.StartTime.TimeOfDay < ListForType[i].StopTime.TimeOfDay)
         {
             return(true);
         }
         if (sd.SchedDefaultNum != ListForType[i].SchedDefaultNum &&
             sd.DayOfWeek == ListForType[i].DayOfWeek &&
             sd.StopTime.TimeOfDay > ListForType[i].StartTime.TimeOfDay &&
             sd.StopTime.TimeOfDay <= ListForType[i].StopTime.TimeOfDay)
         {
             return(true);
         }
         if (sd.SchedDefaultNum != ListForType[i].SchedDefaultNum &&
             sd.DayOfWeek == ListForType[i].DayOfWeek &&
             sd.StartTime.TimeOfDay <= ListForType[i].StartTime.TimeOfDay &&
             sd.StopTime.TimeOfDay >= ListForType[i].StopTime.TimeOfDay)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
 private void FillList()
 {
     Schedule[] SchedListAll = Schedules.RefreshDay(SchedCurDate);
     SchedListDay = Schedules.GetForType(SchedListAll, SchedType, ProvNum);
     SchedDefaults.Refresh();
     SchedDefault[] schedDefForType = SchedDefaults.GetForType(SchedType, ProvNum);
     listTimeBlocks.Items.Clear();
     ALdefaults           = new ArrayList();
     labelDefault.Visible = false;
     if (SchedListDay.Length == 0)
     {
         //show defaults instead of user-entered list
         for (int i = 0; i < schedDefForType.Length; i++)
         {
             if ((int)SchedCurDate.DayOfWeek == schedDefForType[i].DayOfWeek)
             {
                 ALdefaults.Add(schedDefForType[i]);
                 listTimeBlocks.Items.Add(schedDefForType[i].StartTime.ToShortTimeString() + " - "
                                          + schedDefForType[i].StopTime.ToShortTimeString());
             }
         }
         labelDefault.Visible = true;
     }
     else//show the list of user-entered schedule items
     {
         if (SchedListDay.Length == 1 && SchedListDay[0].Status == SchedStatus.Closed)
         {
             listTimeBlocks.Items.Add("Office Closed " + SchedListDay[0].Note);
         }
         else if (SchedListDay.Length == 1 && SchedListDay[0].Status == SchedStatus.Holiday)
         {
             listTimeBlocks.Items.Add("Holiday: " + SchedListDay[0].Note);
         }
         else
         {
             for (int i = 0; i < SchedListDay.Length; i++)
             {
                 listTimeBlocks.Items.Add(SchedListDay[i].StartTime.ToShortTimeString() + " - "
                                          + SchedListDay[i].StopTime.ToShortTimeString());
             }
         }
     }
 }