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); }
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); }
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); }
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); }
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; }
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; }
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; }
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; }