Example #1
0
 static public void DeleteTeen(int id)
 {
     TeenNight.DeleteTeenNights(id);
     using (var db = Code.TeenDataHelper.GetEE())
     {
         var g = db.Teens.Where(x => x.id == id).FirstOrDefault();
         if (g == null)
         {
             return;
         }
         db.Teens.Remove(g);
         db.SaveChanges();
     }
 }
Example #2
0
 public void StoreAttendance()
 {
     for (int x = 0; x < LstAttended.Count; x++)
     {
         var tnd = TeenNight.ReadSingleTeenNights(this.id, DateList[x]);
         if (tnd == null)
         {
             tnd                = new TeenNight();
             tnd.Attended       = LstAttended[x] ? "Y" : "N";
             tnd.Decision       = LstDecision[x];
             tnd.AttendanceDate = DateList[x];
             tnd.TeenId         = id;
             tnd.Save();
         }
         else
         {
             tnd.Attended = LstAttended[x] ? "Y" : "N";
             tnd.Decision = LstDecision[x];
             tnd.Update();
         }
     }
 }
Example #3
0
 public void StoreAttendance()
 {
     for (int x = 0; x < LstAttended.Count; x++)
     {
         var tnd = TeenNight.ReadSingleTeenNights(this.id, DateList[x]);
         if (tnd == null)
         {
             tnd = new TeenNight();
             tnd.Attended = LstAttended[x] ? "Y" : "N";
             tnd.Decision = LstDecision[x];
             tnd.AttendanceDate = DateList[x];
             tnd.TeenId = id;
             tnd.Save();
         }
         else
         {
             tnd.Attended = LstAttended[x] ? "Y" : "N";
             tnd.Decision = LstDecision[x];
             tnd.Update();
         }
     }
 }