コード例 #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();
     }
 }
コード例 #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();
         }
     }
 }
コード例 #3
0
ファイル: Teen.cs プロジェクト: Delnar/TeenCheckin
 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();
         }
     }
 }