Beispiel #1
0
        private void btnViewAttendance_Click(object sender, EventArgs e)
        {
            var presentEmployeeUserControl = new PresentEmployeeUserControl(1, DateTime.Now, "TEST");

            presentEmployeeUserControl.mainForm = mainForm;

            presentEmployeesFlowLayoutPanel.Controls.Add(presentEmployeeUserControl);
        }
Beispiel #2
0
        public void LoadPresentEmployeeFlowLayoutPanel()
        {
            presentEmployeesFlowLayoutPanel.Controls.Clear();

            var presentEmployees = mainForm.AttendanceRepository.GetAttendancesByDate().Where(a => a.TimeInDate.Date == DateTime.Now.Date &&
                                                                                              a.TimeOutDate == null &&
                                                                                              a.Employee.BranchId == mainForm.UserInformation.BranchId);

            lblPresentEmployees.Text = presentEmployees.Count().ToString();

            foreach (var employee in presentEmployees)
            {
                var presentEmployeeUserControl = new PresentEmployeeUserControl(employee.EmployeeId,
                                                                                employee.TimeInDate,
                                                                                $"{employee.Employee.FirstName} {employee.Employee.MiddleName} {employee.Employee.LastName}");
                presentEmployeeUserControl.mainForm = mainForm;

                presentEmployeesFlowLayoutPanel.Controls.Add(presentEmployeeUserControl);
            }
        }