// מחיקה public static void DeleteScheduling(int id) { using (var context = new PARENTSEntities()) { scheduling scheduling = context.scheduling.Where(p => p.code == id).FirstOrDefault(); context.scheduling.Remove(scheduling); context.SaveChanges(); } }
//הוספת public static int AddScheduling(scheduling scheduling) { using (var context = new PARENTSEntities()) { scheduling s = context.scheduling.Add(scheduling); context.SaveChanges(); return(s.code); } }
//הוספת public static int AddInstation(instation instation) { using (var context = new PARENTSEntities()) { instation i = context.instation.Add(instation); context.SaveChanges(); return(i.code); } }
// מחיקה public static void DeleteInstation(int code) { using (var context = new PARENTSEntities()) { instation instation = context.instation.Where(p => p.code == code).FirstOrDefault(); context.instation.Remove(instation); context.SaveChanges(); } }
// מחיקה public static void DeleteRequest(string id) { using (var context = new PARENTSEntities()) { request request = context.request.Where(p => p.code.Equals(id)).FirstOrDefault(); context.request.Remove(request); context.SaveChanges(); } }
// מחיקה public static void DeleteParents(string id) { using (var context = new PARENTSEntities()) { parents parents = context.parents.Where(p => p.id.Equals(id)).FirstOrDefault(); context.parents.Remove(parents); context.SaveChanges(); } }
//הוספת public static int AddRequest(request request) { using (var context = new PARENTSEntities()) { request r = context.request.Add(request); context.SaveChanges(); return(r.code); } }
//הוספת public static string AddTeachers(teachers teachers) { using (var context = new PARENTSEntities()) { teachers t = context.teachers.Add(teachers); context.SaveChanges(); return(t.id); } }
//הוספת public static string AddParents(parents parents) { using (var context = new PARENTSEntities()) { parents p = context.parents.Add(parents); context.SaveChanges(); return(p.id); } }
// מחיקה 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(); } }
//הוספת public static int AddTimes(times times) { using (var context = new PARENTSEntities()) { times t = context.times.Add(times); context.SaveChanges(); return(t.code); } }
//עדכון כניסה public static List <scheduling> updateEnter(string id) { using (var context = new PARENTSEntities()) { scheduling scheduling = context.scheduling.Where(a => a.studens.id == id).FirstOrDefault(); scheduling.hour_enter = DateTime.Now.TimeOfDay; UpdateScheduling(scheduling); context.SaveChanges(); return(GetParentsThatWaitToClass(scheduling.code_class)); } }
//עדכון public static void UpdateClass(classes classes) { using (var context = new PARENTSEntities()) { classes pro = context.classes.Where(p => p.code == classes.code).FirstOrDefault(); if (pro != null) { pro.code = classes.code; pro.num_class = classes.num_class; pro.id_teacher = classes.id_teacher; context.SaveChanges(); } } }
//עדכון public static void UpdateTeachers(teachers teachers) { using (var context = new PARENTSEntities()) { teachers t = context.teachers.Where(x => x.id == teachers.id).FirstOrDefault(); if (t != null) { t.code_instation = teachers.code_instation; t.id = teachers.id; t.NAME = teachers.NAME; t.telefone = teachers.telefone; context.SaveChanges(); } } }
//עדכון 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(); } } }
//עדכון public static void UpdateStudens(studens studens) { using (var context = new PARENTSEntities()) { studens s = context.studens.Where(x => x.id == studens.id).FirstOrDefault(); if (s != null) { s.id = studens.id; s.last_name = studens.last_name; s.first_name = studens.first_name; s.code_class = studens.code_class; s.id_parent = studens.id_parent; context.SaveChanges(); } } }
//עדכון public static void UpdateRequest(request request) { using (var context = new PARENTSEntities()) { request r = context.request.Where(x => x.code == request.code).FirstOrDefault(); if (r != null) { r.code = request.code; r.id_parent = request.id_parent; r.from_hour = request.from_hour; r.to_hour = request.to_hour; context.SaveChanges(); } } }
//עדכון public static void UpdateInstation(instation instation) { using (var context = new PARENTSEntities()) { instation pro = context.instation.Where(p => p.code == instation.code).FirstOrDefault(); if (pro != null) { pro.code = instation.code; pro.email = instation.email; pro.NAME = instation.NAME; pro.password = instation.password; pro.imege = instation.imege; context.SaveChanges(); } } }
//עדכון public static void UpdateParents(parents parents) { using (var context = new PARENTSEntities()) { parents p = context.parents.Where(x => x.id == parents.id).FirstOrDefault(); if (p != null) { p.id = parents.id; p.first_name = parents.first_name; p.code_instation = parents.code_instation; p.email = parents.email; p.last_name = parents.last_name; p.telefone = parents.telefone; context.SaveChanges(); } } }
//עדכון public static void UpdateScheduling(scheduling scheduling) { using (var context = new PARENTSEntities()) { scheduling s = context.scheduling.Where(x => x.code == scheduling.code).FirstOrDefault(); if (s != null) { s.code = scheduling.code; s.code_class = scheduling.code_class; s.hour_ = scheduling.hour_; s.hour_enter = scheduling.hour_enter; s.hour_exit = scheduling.hour_exit; s.hour_reach = scheduling.hour_reach; s.id_student = scheduling.id_student; context.SaveChanges(); } } }