Exemplo n.º 1
0
        async Task <IEnumerable <ClassSubject> > FetchSubjectList()
        {
            var sqlString = KontrolaSQL.SelectPrzedmiot(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 ClassSubject
                {
                    ClassID = Convert.ToInt32(R["Klasa"]),
                    SubjectID = Convert.ToInt32(R["Przedmiot"]),
                    Group = (YesNo)Convert.ToUInt64(R["Grupa"]),
                    SubjectName = R["Nazwa"].ToString(),
                    SubjectPriority = Convert.ToByte(R["Priorytet"])
                }));
            }
            //lstPrzedmiot.Clear();

            //foreach (var R in await lst)
            //{
            //	lstPrzedmiot.Add(new ClassSubject
            //	{
            //		ClassID = Convert.ToInt32(R["Klasa"]),
            //		SubjectID = Convert.ToInt32(R["Przedmiot"]),
            //		Group = (YesNo)Convert.ToUInt64(R["Grupa"]),
            //		SubjectName = R["Nazwa"].ToString(),
            //		SubjectPriority = Convert.ToByte(R["Priorytet"])
            //	});
            //}
        }
Exemplo n.º 2
0
        async Task <IEnumerable <ClassSubject> > FetchSubjectList()
        {
            var sqlString = KontrolaSQL.SelectPrzedmiot(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 ClassSubject
                {
                    ClassID = Convert.ToInt32(R["Klasa"]),
                    Subject = new SchoolSubject
                    {
                        SubjectID = Convert.ToInt32(R["ID"]),
                        SubjectName = Convert.ToString(R["Nazwa"]),
                        SubjectPriority = Convert.ToByte(R["Priorytet"])
                    }
                }));
            }
        }