internal BranchPeoplePaginationAttendance GetPeoplesIndividualAttendance(BranchPeopleAttendance branchPeopleAttendance)
        {
            var tableResponse = _dbConnection.GetModelDetails(RawSQL.ReportsBranchIndividualAttendance(branchPeopleAttendance));
            List <BranchPeopleAttendance> lst = new List <BranchPeopleAttendance>();

            foreach (DataRow dataRow in tableResponse.AsEnumerable())
            {
                var record = new BranchPeopleAttendance()
                {
                    UidNo   = dataRow.Field <string>("UID_No") ?? "",
                    Name    = dataRow.Field <string>("Name_Full"),
                    RollNo  = Convert.ToInt32(dataRow.Field <double>("Roll_No")),
                    BrTitle = dataRow.Field <string>("INI_JIG_NON") == "INI" ? "Initiated"
                                    : dataRow.Field <string>("INI_JIG_NON") == "CHL" ? "Children"
                                    : dataRow.Field <string>("INI_JIG_NON") == "OTH" ? "Other"
                                    : dataRow.Field <string>("INI_JIG_NON") == "JIG" ? "Jigyasu" : "",
                    AttendanceCount = dataRow.Field <int?>("AttendanceCount"),
                    ActivityName    = dataRow.Field <string>("Act_Name"),
                    AttendanceDate  = dataRow.Field <DateTime?>("Act_Date")
                };
                lst.Add(record);
            }
            var finalLst = new BranchPeoplePaginationAttendance
            {
                BranchPeopleAttendance = lst,
                Count = 0
            };

            return(finalLst);
        }
        internal BranchPeoplePaginationAttendance GetPeopleAttendance(BranchPeopleAttendance branchPeopleAttendance, int page)
        {
            var lst = new List <BranchPeopleAttendance>();

            // Users Attendance
            var tableResponse = _dbConnection.GetModelDetails(RawSQL.ReportsBranchPeopleAttendance(branchPeopleAttendance));

            foreach (DataRow dataRow in tableResponse.AsEnumerable())
            {
                var record = new BranchPeopleAttendance
                {
                    UidNo   = dataRow.Field <string>("UID_No") ?? "",
                    Name    = dataRow.Field <string>("Name_Full"),
                    RollNo  = Convert.ToInt32(dataRow.Field <double>("Roll_No")),
                    BrTitle = dataRow.Field <string>("INI_JIG_NON") == "INI" ? "Initiated"
                                    : dataRow.Field <string>("INI_JIG_NON") == "CHL" ? "Children"
                                    : dataRow.Field <string>("INI_JIG_NON") == "OTH" ? "Other"
                                    : dataRow.Field <string>("INI_JIG_NON") == "JIG" ? "Jigyasu" : "",
                    AttendanceCount    = dataRow.Field <int?>("AttendanceCount"),
                    ActivityName       = dataRow.Field <string>("Act_Name"),
                    SingleActivityCode = dataRow.Field <string>("Act_cd"),
                    AttendanceDate     = dataRow.Field <DateTime?>("Act_Date"),
                    MobileNum          = dataRow.Field <string>("Mobile")
                };
                lst.Add(record);
            }

            // Visitors Attendance Result
            var visitorsAttendance = _dbConnection.GetModelDetails(RawSQL.ReportsBranchVisitorsPeopleSummary(branchPeopleAttendance.ActivityCode,
                                                                                                             branchPeopleAttendance.StartDate, branchPeopleAttendance.EndDate));

            foreach (DataRow dataRow in visitorsAttendance.AsEnumerable())
            {
                var record = new BranchPeopleAttendance()
                {
                    BrTitle        = dataRow.Field <string>("Initiated").ToLower() == "yes".ToLower() ? "Initiated" : "Other",
                    ActivityName   = dataRow.Field <string>("Act_Name"),
                    AttendanceDate = dataRow.Field <DateTime?>("Act_Date"),
                    IsVisitors     = true
                };
                lst.Add(record);
            }

            // Voided Records
            var tableResponseVoidedRec = _dbConnection.GetModelDetails(RawSQL.ReportsBranchPeopleAttendanceVoided(branchPeopleAttendance.ActivityCode, branchPeopleAttendance.StartDate, branchPeopleAttendance.EndDate));

            foreach (DataRow dataRow in tableResponseVoidedRec.AsEnumerable())
            {
                var record = new BranchPeopleAttendance
                {
                    UidNo              = "NA",
                    Name               = "NA",
                    RollNo             = -1,
                    BrTitle            = "NA",
                    AttendanceCount    = -1,
                    ActivityName       = dataRow.Field <string>("Act_Name"),
                    SingleActivityCode = dataRow.Field <string>("Act_cd"),
                    AttendanceDate     = dataRow.Field <DateTime?>("Act_Date"),
                    MobileNum          = "NA"
                };
                lst.Add(record);
            }
            var count    = lst.Count();
            var finalLst = new BranchPeoplePaginationAttendance
            {
                BranchPeopleAttendance = lst.Skip((page - 1) * 500).Take(500).ToList(),
                Count = count
            };

            return(finalLst);
        }