public static List <EmployeeLog> LoadDataEmployeeLog()
        {
            List <EmployeeLog> employees = new List <EmployeeLog>();
            MySqlConnection    conn      = new MySqlConnection(GlobalVariable.ConnectionString);

            try
            {
                conn.Open();
                MySqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = QueryGetDataEmployeeLog();
                MySqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    EmployeeLog emp = new EmployeeLog();
                    emp.EmployeeLogID              = ReaderHepler.GetValueFromReader <int>(reader, nameof(EmployeeLog.EmployeeLogID));
                    emp.Firstname                  = ReaderHepler.GetValueFromReader <string>(reader, nameof(EmployeeLog.Firstname));
                    emp.Lastname                   = ReaderHepler.GetValueFromReader <string>(reader, nameof(EmployeeLog.Lastname));
                    emp.DateOfBirth                = ReaderHepler.GetValueFromReader <DateTime>(reader, nameof(EmployeeLog.DateOfBirth));
                    emp.StartWorkDate              = ReaderHepler.GetValueFromReader <DateTime>(reader, nameof(EmployeeLog.StartWorkDate));
                    emp.Salary                     = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLog.Salary));
                    emp.ProvidentFundRate          = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLog.ProvidentFundRate));
                    emp.ProvidentFundCollectAmount = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLog.ProvidentFundCollectAmount));
                    emp.employeeLogDetails         = GetEmployeeLogDetail(emp.EmployeeLogID);

                    employees.Add(emp);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }

            return(employees);
        }
        public static List <EmployeeLogDetail> GetEmployeeLogDetail(int employeeLogID)
        {
            List <EmployeeLogDetail> employeeLogDetails = new List <EmployeeLogDetail>();
            MySqlConnection          conn = new MySqlConnection(GlobalVariable.ConnectionString);

            try
            {
                conn.Open();
                MySqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = QueryGetEmployeeLogDetail(employeeLogID);
                MySqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    EmployeeLogDetail emp = new EmployeeLogDetail();
                    emp.EmployeeLogID       = ReaderHepler.GetValueFromReader <int>(reader, nameof(EmployeeLogDetail.EmployeeLogID));
                    emp.EmployeeLogDetailID = ReaderHepler.GetValueFromReader <int>(reader, nameof(EmployeeLogDetail.EmployeeLogDetailID));
                    emp.WorkYear            = ReaderHepler.GetValueFromReader <string>(reader, nameof(EmployeeLogDetail.WorkYear));
                    emp.Month                = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLogDetail.Month));
                    emp.Salary               = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLogDetail.Salary));
                    emp.PVDRate              = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLogDetail.PVDRate));
                    emp.CompanyPaidPercent   = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLogDetail.CompanyPaidPercent));
                    emp.ProvidentFundCollect = ReaderHepler.GetValueFromReader <decimal>(reader, nameof(EmployeeLogDetail.ProvidentFundCollect));

                    employeeLogDetails.Add(emp);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }

            return(employeeLogDetails);
        }