Exemple #1
0
        private void butCloseOffice_Click(object sender, System.EventArgs e)
        {
            if (SchedListDay.Length == 1 &&
                SchedListDay[0].Status == SchedStatus.Closed)
            {
                MessageBox.Show(Lan.g(this, "Day is already Closed."));
                return;
            }
            if (SchedListDay.Length > 0)
            {
                for (int i = 0; i < SchedListDay.Length; i++)
                {
                    Schedules.Delete(SchedListDay[i]);
                }
            }
            Schedule SchedCur = new Schedule();

            SchedCur.SchedDate = SchedCurDate;
            SchedCur.Status    = SchedStatus.Closed;
            SchedCur.SchedType = SchedType;
            SchedCur.ProvNum   = ProvNum;
            FormScheduleBlockEdit FormSB = new FormScheduleBlockEdit(SchedCur);

            FormSB.IsNew = true;
            FormSB.ShowDialog();
            FillList();
        }
Exemple #2
0
        private void butAddTime_Click(object sender, System.EventArgs e)
        {
            Schedules.ConvertFromDefault(SchedCurDate, SchedType, ProvNum);
            Schedule SchedCur = new Schedule();

            SchedCur.SchedDate = SchedCurDate;
            SchedCur.Status    = SchedStatus.Open;
            SchedCur.SchedType = SchedType;
            SchedCur.ProvNum   = ProvNum;
            FormScheduleBlockEdit FormSB = new FormScheduleBlockEdit(SchedCur);

            FormSB.IsNew = true;
            FormSB.ShowDialog();
            labelDefault.Visible = false;
            FillList();
        }
Exemple #3
0
        private void listTimeBlocks_DoubleClick(object sender, System.EventArgs e)
        {
            if (listTimeBlocks.SelectedIndex == -1)
            {
                return;
            }
            int clickedIndex = listTimeBlocks.SelectedIndex;

            if (Schedules.ConvertFromDefault(SchedCurDate, SchedType, ProvNum))
            {
                FillList();
            }
            Schedule SchedCur            = SchedListDay[clickedIndex];
            FormScheduleBlockEdit FormSB = new FormScheduleBlockEdit(SchedCur);

            FormSB.ShowDialog();
            FillList();
        }
Exemple #4
0
        private void butHoliday_Click(object sender, System.EventArgs e)
        {
            if (SchedListDay.Length == 1 &&
                SchedListDay[0].Status == SchedStatus.Holiday)
            {
                MessageBox.Show(Lan.g(this, "Day is already a Holiday."));
                return;
            }
            Schedules.SetAllDefault(SchedCurDate, SchedType, ProvNum);
            FillList();
            Schedule SchedCur = new Schedule();

            SchedCur.SchedDate = SchedCurDate;
            SchedCur.Status    = SchedStatus.Holiday;
            SchedCur.SchedType = SchedType;
            SchedCur.ProvNum   = ProvNum;
            FormScheduleBlockEdit FormSB = new FormScheduleBlockEdit(SchedCur);

            FormSB.IsNew = true;
            FormSB.ShowDialog();
            FillList();
        }
		private void OnBlockAdd_Click() {
			if(!Security.IsAuthorized(Permissions.Blockouts)) {
				return;
			}
			Schedule SchedCur=new Schedule();
			SchedCur.SchedDate=AppointmentL.DateSelected;
			if(ApptDrawing.IsWeeklyView) {
				SchedCur.SchedDate=WeekStartDate.AddDays(SheetClickedonDay);
			}
			SchedCur.SchedType=ScheduleType.Blockout;
			FormScheduleBlockEdit FormSB=new FormScheduleBlockEdit(SchedCur);
			FormSB.IsNew=true;
			FormSB.ShowDialog();
			SecurityLogs.MakeLogEntry(Permissions.Blockouts,0,"Blockout add.");
			RefreshPeriod();
		}
		private void OnBlockEdit_Click() {
			if(!Security.IsAuthorized(Permissions.Blockouts)) {
				return;
			}
			//not even enabled if not right click on a blockout
			Schedule SchedCur=GetClickedBlockout();
			if(SchedCur==null) {
				MessageBox.Show("Blockout not found.");
				return;//should never happen
			}
			FormScheduleBlockEdit FormSB=new FormScheduleBlockEdit(SchedCur);
			FormSB.ShowDialog();
			SecurityLogs.MakeLogEntry(Permissions.Blockouts,0,"Blockout edit.");
			RefreshPeriod();
		}