예제 #1
0
        public static List <DayCarePL.ChildDataProperties> GetAllActiveChildListForImport(Guid CurrentSchoolYearId, Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clChildSchoolYear, "GetAllActiveChildListForImport", "Execute GetAllActiveChildListForImport Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clChildSchoolYear, "GetAllActiveChildListForImport", "Debug GetAllActiveChildListForImport Method", DayCarePL.Common.GUID_DEFAULT);
                var Data = db.spGetAllActiveChildListForImport(CurrentSchoolYearId, SchoolId);
                DayCarePL.ChildDataProperties        objChildData;
                List <DayCarePL.ChildDataProperties> lstChildData = new List <DayCarePL.ChildDataProperties>();

                foreach (var d in Data)
                {
                    objChildData               = new DayCarePL.ChildDataProperties();
                    objChildData.ChildDataId   = d.ChildDataId;
                    objChildData.FullName      = d.FullName;
                    objChildData.FamilyName    = d.FamilyName;
                    objChildData.ChildFamilyId = d.ChildFamilyId;
                    objChildData.ImportedCount = d.ImportedCount == null ? 0 : d.ImportedCount.Value;
                    lstChildData.Add(objChildData);
                }
                return(lstChildData);;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChildSchoolYear, "GetAllActiveChildListForImport", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(new List <DayCarePL.ChildDataProperties>());
            }
        }