public DateCorrectForm(ref Form tTopForm, int DayEventType) { InitializeComponent(); TopForm = tTopForm; if (DayEventType == dBreakDay) { label2.Text = "Пойти на перерыв"; BreakButton.BringToFront(); BreakButtonChanged.BringToFront(); if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { xtraTabPage1.PageEnabled = false; OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } } if (DayEventType == dContinueDay) { label2.Text = "Продолжить рабочий день"; ContinueButton.BringToFront(); ContinueButtonChanged.BringToFront(); if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { xtraTabPage1.PageEnabled = false; OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } } if (DayEventType == dStartDay) { label2.Text = "Начать рабочий день"; StartButton.BringToFront(); StartButtonChanged.BringToFront(); } if (DayEventType == dEndDay) { label2.Text = "Завершить рабочий день"; StopButton.BringToFront(); StopButtonChanged.BringToFront(); if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { xtraTabPage1.PageEnabled = false; OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } } label1.Text = Security.GetCurrentDate().ToString("HH:mm"); timeEdit1.EditValue = Security.GetCurrentDate(); }
public EditTimeForm(ref Form tTopForm, int tDayEventType, ref DayFactStatus DayFactStatus, ref DayStatus DayStatus) { InitializeComponent(); DayEventType = tDayEventType; TopForm = tTopForm; if (DayEventType == dBreakDay) { label2.Text = "Изменить время начала перерыва"; if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } timeEdit1.EditValue = DayStatus.BreakStarted; FactTimeLabel.Text = "с " + DayFactStatus.BreakFactStarted.ToString("HH:mm") + " на"; richTextBox1.Text = DayFactStatus.DayBreakStartNotes; } if (DayEventType == dContinueDay) { label2.Text = "Изменить время окончания перерыва"; if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } timeEdit1.EditValue = DayStatus.BreakEnded; FactTimeLabel.Text = "с " + DayFactStatus.BreakFactEnded.ToString("HH:mm") + " на"; richTextBox1.Text = DayFactStatus.DayContinueNotes; } if (DayEventType == dStartDay) { label2.Text = "Изменить время начала рабочего дня"; if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } timeEdit1.EditValue = DayStatus.DayStarted; FactTimeLabel.Text = "с " + DayFactStatus.DayFactStarted.ToString("HH:mm") + " на"; richTextBox1.Text = DayFactStatus.DayStartNotes; } if (DayEventType == dEndDay) { label2.Text = "Изменить время завершения рабочего дня"; if (LightWorkDay.IsDayOverdued(Security.CurrentUserID, ref OverduedDateTime)) { OverduedDateLabel.Visible = true; OverduedDateLabel.Text = OverduedDateTime.ToString("dd.MM.yyyy"); IsOverdued = true; } timeEdit1.EditValue = DayStatus.DayEnded; FactTimeLabel.Text = "с " + DayFactStatus.DayFactEnded.ToString("HH:mm") + " на"; richTextBox1.Text = DayFactStatus.DayEndNotes; } if (((DateTime)timeEdit1.EditValue).ToString("dd.MM.yyyy") == "01.01.0001") { timeEdit1.EditValue = OverduedDateTime; } }