コード例 #1
0
        internal SavedAttendanceModal GetSavedAttendance(string actCode, DateTime actDate)
        {
            var tableResponse = _dbConnection.GetModelDetails(RawSQL.GetSavedAttendance(actCode, actDate));
            SavedAttendanceModal peopleList = new SavedAttendanceModal();
            List <SavedAttendancePeopleModal> attendPeopleList = new List <SavedAttendancePeopleModal>();

            foreach (DataRow dataRow in tableResponse.AsEnumerable())
            {
                var record = new SavedAttendancePeopleModal()
                {
                    BranchName   = "OD Branch",
                    Gender       = dataRow.Field <string>("Gender"),
                    Name         = dataRow.Field <string>("Name_Full"),
                    IniJigStatus = dataRow.Field <string>("INI_JIG_NON") == "INI" ? "Initiated"
                                    : dataRow.Field <string>("INI_JIG_NON") == "CHL" ? "Child"
                                    : dataRow.Field <string>("INI_JIG_NON") == "OTH" ? "Other"
                                    : dataRow.Field <string>("INI_JIG_NON") == "JIG" ? "Jigyasu" : "",
                    IsSantSu = dataRow.Field <string>("Sant_su") != null ? "Y": "N",
                    UidNo    = dataRow.Field <string>("UID_No") ?? "",
                    RollNo   = dataRow.Field <Int16>("Roll_No").ToString()
                };
                attendPeopleList.Add(record);
            }
            peopleList.SavedAttendancePeopleModals = attendPeopleList;
            peopleList.SavedAttendancePeopleModals.AddRange(GetSavedVisitorsAttendance(actCode, actDate));

            var actRes = _dbConnection.GetModelDetails(RawSQL.GetSingleActivity(actCode, actDate));

            peopleList.ActivityDate = actDate;
            peopleList.ActivityName = actRes.AsEnumerable().FirstOrDefault()?.Field <string>("ActName");
            return(peopleList);
        }
コード例 #2
0
        private List <SavedAttendancePeopleModal> GetSavedVisitorsAttendance(string actCode, DateTime actDate)
        {
            var tableResponse = _dbConnection.GetModelDetails(RawSQL.GetSaveVisitorsAttendance(actCode, actDate));
            List <SavedAttendancePeopleModal> attendPeopleList = new List <SavedAttendancePeopleModal>();

            foreach (DataRow dataRow in tableResponse.AsEnumerable())
            {
                var record = new SavedAttendancePeopleModal()
                {
                    BranchName   = "Visitors Branch",
                    Gender       = dataRow.Field <string>("Gender"),
                    Name         = dataRow.Field <string>("VisitorName"),
                    IniJigStatus = dataRow.Field <string>("Initiated").ToLower() == "yes" ? "Initiated"
                                    : "Other"
                };
                attendPeopleList.Add(record);
            }
            return(attendPeopleList);
        }