Beispiel #1
0
        static public Teen GetTeen(int id)
        {
            Teen ret = null;

            using (var db = Code.TeenDataHelper.GetEE())
            {
                var g = db.Teens.Where(x => x.id == id).FirstOrDefault();
                if (g != null)
                {
                    ret = new Teen(g);
                    ret.PopulateNightData(g.TeenNights.ToList());
                }
            }
            return(ret);
        }
Beispiel #2
0
        static public List <Teen> GetAllTeens()
        {
            List <Teen> ret = new List <Teen>();

            using (var db = Code.TeenDataHelper.GetEE())
            {
                var g = db.Teens.ToList();
                g.ForEach(x =>
                {
                    var t = new Teen(x);
                    t.PopulateNightData(x.TeenNights.ToList());
                    ret.Add(t);
                });
            }
            return(ret);
        }
Beispiel #3
0
        public static Teen GetTeen(int id)
        {
            Teen ret = null;
            using(var db = Code.TeenDataHelper.GetEE())
            {
                var g = db.Teens.Where(x => x.id == id).FirstOrDefault();
                if(g != null)
                {
                    ret = new Teen(g);
                    ret.PopulateNightData(g.TeenNights.ToList());
                }

            }
            return ret;
        }
Beispiel #4
0
 public static List<Teen> GetAllTeens()
 {
     List<Teen> ret = new List<Teen>();
     using(var db = Code.TeenDataHelper.GetEE())
     {
         var g = db.Teens.ToList();
         g.ForEach(x =>
         {
             var t = new Teen(x);
             t.PopulateNightData(x.TeenNights.ToList());
             ret.Add(t);
         });
     }
     return ret;
 }