示例#1
0
        // מחיקה

        public static void DeleteTimes(string code)
        {
            using (var context = new PARENTSEntities())
            {
                times times = context.times.Where(p => p.code.Equals(code)).FirstOrDefault();
                context.times.Remove(times);
                context.SaveChanges();
            }
        }
示例#2
0
 //הוספת
 public static int AddTimes(times times)
 {
     using (var context = new PARENTSEntities())
     {
         times t = context.times.Add(times);
         context.SaveChanges();
         return(t.code);
     }
 }
示例#3
0
        //מקבל תז תלמיד
        public static times GetTimesForMother(string id)
        {
            using (var context = new PARENTSEntities())
            {
                times times = context.studens.FirstOrDefault(j => j.id == id).classes.times.FirstOrDefault();



                return(times);
            }
        }
示例#4
0
 //עדכון
 public static void UpdateTimes(times times)
 {
     using (var context = new PARENTSEntities())
     {
         times t = context.times.Where(x => x.code == times.code).FirstOrDefault();
         if (t != null)
         {
             t.code       = times.code;
             t.code_class = times.code_class;
             t.from_hour  = times.from_hour;
             t.to_hour    = times.to_hour;
             context.SaveChanges();
         }
     }
 }