Beispiel #1
0
        async Task <IEnumerable <SubjectStaff> > FetchSubjectStaff()
        {
            var sqlString = StatystykaSQL.SelectObsada(UserSession.User.Settings.SchoolID.ToString(), UserSession.User.Settings.SchoolYear, rbOkres.Tag.ToString() == "S" ? EndOfSemester : EndOfSchoolYear);

            using (var scope = AppSession.TypeContainer.BeginLifetimeScope())
            {
                var dbs = scope.Resolve <IDataBaseService>();
                return(await dbs.FetchRecordSetAsync(sqlString, (R) => new SubjectStaff
                {
                    Class = new StaffUnit {
                        ID = Convert.ToInt32(R["Klasa"]), Nazwa = R["Nazwa_Klasy"].ToString()
                    },
                    Subject = new SubjectUnit
                    {
                        ID = Convert.ToInt32(R["IdPrzedmiot"]),
                        Nazwa = R["Przedmiot"].ToString(),
                        IdSzkolaPrzedmiot = Convert.ToInt32(R["IdSzkolaPrzedmiot"])
                    },
                    Teacher = new StaffUnit {
                        ID = Convert.ToInt32(R["IdNauczyciel"]), Nazwa = R["Nauczyciel"].ToString()
                    },
                    IsVirtual = Convert.ToBoolean(R["IsVirtual"])
                }));
            }
        }
Beispiel #2
0
        async Task <IEnumerable <StudentCount> > FetchStudentCount()
        {
            var sqlString = StatystykaSQL.SelectStanKlasy(UserSession.User.Settings.SchoolID.ToString(), UserSession.User.Settings.SchoolYear, rbOkres.Tag.ToString() == "S" ? EndOfSemester : EndOfSchoolYear);

            using (var scope = AppSession.TypeContainer.BeginLifetimeScope())
            {
                var dbs = scope.Resolve <IDataBaseService>();
                return(await dbs.FetchRecordSetAsync(sqlString, (R) => new StudentCount { ClassID = Convert.ToInt32(R["Klasa"]), Count = Convert.ToInt32(R["StanKlasy"]) }));
            }
        }
Beispiel #3
0
        async Task <IEnumerable <SubjectGroupCount> > FetchSubjectGroupCount()
        {
            var sqlString = StatystykaSQL.CountGroupMember(UserSession.User.Settings.SchoolID.ToString(), UserSession.User.Settings.SchoolYear);

            using (var scope = AppSession.TypeContainer.BeginLifetimeScope())
            {
                var dbs = scope.Resolve <IDataBaseService>();
                return(await dbs.FetchRecordSetAsync(sqlString, (R) => new SubjectGroupCount
                {
                    ClassID = Convert.ToInt32(R["Klasa"]),
                    Count = Convert.ToInt32(R["StanGrupy"]),
                    SubjectID = Convert.ToInt32(R["IdPrzedmiot"]),
                    SubjectIdBySchool = Convert.ToInt32(R["IdSzkolaPrzedmiot"])
                }));
            }
        }
Beispiel #4
0
        async Task <IEnumerable <ScoreInfo> > FetchScoreInfo()
        {
            var sqlString = StatystykaSQL.SelectLiczbaOcen(UserSession.User.Settings.SchoolID.ToString(), UserSession.User.Settings.SchoolYear, rbOkres.Tag.ToString());

            using (var scope = AppSession.TypeContainer.BeginLifetimeScope())
            {
                var dbs = scope.Resolve <IDataBaseService>();
                return(await dbs.FetchRecordSetAsync(sqlString, (R) => new ScoreInfo
                {
                    ScoreCount = Convert.ToInt32(R["LiczbaOcen"]),
                    ScoreWeight = Convert.ToInt32(R["Waga"]),
                    ClassID = Convert.ToInt32(R["Klasa"]),
                    SubjectID = Convert.ToInt32(R["IdPrzedmiot"]),
                    TeacherID = Convert.ToInt32(R["Nauczyciel"])
                }));
            }
        }
Beispiel #5
0
        async Task <IEnumerable <SchoolStudent> > FetchStudent()
        {
            var sqlString = StatystykaSQL.CountGroupMember(UserSession.User.Settings.SchoolID.ToString(), UserSession.User.Settings.SchoolYear);

            using (var scope = AppSession.TypeContainer.BeginLifetimeScope())
            {
                var dbs = scope.Resolve <IDataBaseService>();
                return(await dbs.FetchRecordSetAsync(sqlString, (R) => new SchoolStudent
                {
                    Student = new IdentUnit {
                        ID = Convert.ToInt32(R["IdUczen"]), Name = R["Student"].ToString()
                    },
                    ActivationStatus = Convert.ToBoolean(R["StatusAktywacji"]),
                    StudentClass = new IdentUnit {
                        ID = Convert.ToInt32(R["IdKlasa"]), Name = R["NazwaKlasy"].ToString()
                    }
                }));
            }
        }