예제 #1
0
        static public Teen GetTeenByGuestOfKey(string GuestOfKey)
        {
            Teen ret = null;

            using (var db = Code.TeenDataHelper.GetEE())
            {
                var g = db.Teens.Where(x => x.GuestOfKey == GuestOfKey).FirstOrDefault();
                if (g != null)
                {
                    ret = new Teen(g);
                }
            }
            return(ret);
        }
예제 #2
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);
        }
예제 #3
0
        static public List <Teen> GetTeensByName(string FirstName, string LastName)
        {
            List <Teen> ret = new List <Teen>();

            using (var db = Code.TeenDataHelper.GetEE())
            {
                var g = db.Teens.Where(x => x.FirstName.ToUpper().StartsWith(FirstName) && x.LastName.ToUpper().StartsWith(LastName)).ToList();
                g.ForEach(x =>
                {
                    var t = new Teen(x);
                    ret.Add(t);
                });
            }
            return(ret);
        }
예제 #4
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);
        }
예제 #5
0
파일: Teen.cs 프로젝트: Delnar/TeenCheckin
 public static List<Teen> GetTeensByName(string FirstName, string LastName)
 {
     List<Teen> ret = new List<Teen>();
     using (var db = Code.TeenDataHelper.GetEE())
     {
         var g = db.Teens.Where(x=> x.FirstName.ToUpper().StartsWith(FirstName) && x.LastName.ToUpper().StartsWith(LastName)).ToList();
         g.ForEach(x =>
         {
             var t = new Teen(x);
             ret.Add(t);
         });
     }
     return ret;
 }
예제 #6
0
파일: Teen.cs 프로젝트: Delnar/TeenCheckin
 public static Teen GetTeenByGuestOfKey(string GuestOfKey)
 {
     Teen ret = null;
     using (var db = Code.TeenDataHelper.GetEE())
     {
         var g = db.Teens.Where(x => x.GuestOfKey == GuestOfKey).FirstOrDefault();
         if (g != null) {
             ret = new Teen(g);
         }
     }
     return ret;
 }
예제 #7
0
파일: Teen.cs 프로젝트: Delnar/TeenCheckin
        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;
        }
예제 #8
0
파일: Teen.cs 프로젝트: Delnar/TeenCheckin
 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;
 }