Skip to content

Commit

Permalink
1. 修正持久化存儲bug 2. 修正員工照片顯示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FongYuanChen committed Nov 28, 2024
1 parent 8b719a1 commit 76d14e1
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 149 deletions.
4 changes: 2 additions & 2 deletions AutomaticAttendanceSystem/Forms/AttendanceSystemForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void TrackWorkProgress()
}
}

if (_employee.IsWorking && _employee.GetAccumulatedWorkTime() >= _employee.DailyWorkHours)
if (_employee.IsWorking && _employee.AccumulatedWorkTime >= _employee.DailyWorkHours)
{
_employee.StopWork();
MessageBoxForm.Show("以滿足今日工時,可以下班了!", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information);
Expand All @@ -122,7 +122,7 @@ private void ShowWorkProgress()
var targetWorkHours = _employee.DailyWorkHours;
targetTimeTextBox.Text = targetWorkHours.ToString(@"hh\:mm\:ss");

var accumulatedTime = _employee.GetAccumulatedWorkTime();
var accumulatedTime = _employee.AccumulatedWorkTime;
accumulatedTimeTextBox.Text = accumulatedTime.ToString(@"hh\:mm\:ss");

var remainingTime = targetWorkHours - accumulatedTime;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AutomaticAttendanceSystem/Forms/EmployeeInformationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void ModifyButton_Click(object sender, EventArgs e)
{
if (MessageBoxForm.Show("確定要修改員工訊息?\n確定後會刪除當前打卡紀錄!", string.Empty, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
_employee.ClearInfo();
_employee.UpdateInfo(null, null, null, TimeSpan.Zero);
ShowModifyForm();
}
}
Expand Down
5 changes: 4 additions & 1 deletion AutomaticAttendanceSystem/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ private void InitializeForm()

_employee.InfoUpdated += () =>
{
ShowFormInPanel(mainPanel, _workHoursManagementForm);
if (_employee.InfoCompleteness)
{
ShowFormInPanel(mainPanel, _workHoursManagementForm);
}
};
}

Expand Down
Loading

0 comments on commit 76d14e1

Please sign in to comment.