private void btn_SearchPage2_Click(object sender, EventArgs e)
        {
            try
            {
                if (dtpk_from.Value.Month != dtpk_to.Value.Month)
                {
                    MessageBox.Show("You have to select data in same month", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (dtpk_from.Value > dtpk_to.Value)
                {
                    MessageBox.Show("You have to select 'To date' > 'From date' ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                GetInoutDataFromEmployee inoutDataFromEmployee = new GetInoutDataFromEmployee();
                listInoutSeasonal      = inoutDataFromEmployee.GetInoutDatasFromDateTime(dtpk_from.Value, dtpk_to.Value);
                inoutDatasAfterConvert = ListInOutAfterPaipanTable(listInoutSeasonal);


                LoadTreeViewFromListInoutData(inoutDatasAfterConvert);
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "data NG", ex.Message);
            }
        }
        private List <InoutData> ListInOutAfterPaipanTable(List <InoutData> inoutDatas)
        {
            List <InoutData>         listInoutReturn       = new List <InoutData>();
            GetInoutDataFromEmployee inoutDataFromEmployee = new GetInoutDataFromEmployee();
            int       SessionID = -1;
            DataTable dtpaiPan  = new DataTable();

            for (int i = 0; i < inoutDatas.Count; i++)
            {
                InoutData inout = new InoutData();
                inout     = inoutDatas[i];
                SessionID = inoutDataFromEmployee.GetSessionID(inoutDatas[i].FDateTime);
                int Date = inoutDatas[i].FDateTime.Day;

                dtpaiPan = inoutDataFromEmployee.GetDataPaipan(SessionID, inoutDatas[i].EmpID);
                if (dtpaiPan.Rows.Count == 1)
                {
                    var Value = dtpaiPan.Rows[0]["B" + Date];
                    if (Value == DBNull.Value)
                    {
                        inout.Shift = "NoShift";
                    }
                    else if ((string)Value.ToString().Trim() == "03" || (string)Value.ToString().Trim() == "07")
                    {
                        inout.Shift = "Night";
                    }
                    else
                    {
                        inout.Shift = "Day";
                    }
                }

                listInoutReturn.Add(inout);
            }
            return(listInoutReturn);
        }