/*Add function*/ public static void addBankToList(bank bank) { using (var db = new HeznekDB()) { db.bank.Add(bank); db.SaveChanges(); } }
/* gets all the evnts from the list of events*/ /* public static List<eventTbl> getAllEvents() * { * using (var db = new HeznekDB) * { * List<eventTbl> events = db.eventTbl.ToList(); * return events; * } * } * * /*update a specific event in the list of events*/ /* public static void updateEventInList(eventTbl updatedEvent) * { * using (var db = new HeznekDB()) * { * List<eventTbl> events = getAllEvents(); * * foreach (var eventIndex in events) * { * if (eventIndex.sn == updatedEvent.sn) * { * eventIndex.nameEvent = updatedEvent.nameEvent; * eventIndex.subjectEvent = updatedEvent.subjectEvent; * db.eventTbl.Remove(eventIndex); * db.eventTbl.Add(updatedEvent); * //NOTE: here the updated event gets a new serial number(KEY) * } * } * } * }*/ /* add an vent to list of events*/ public static void AddEvent(@event eventToAdd) { using (var db = new HeznekDB()) { [email protected](eventToAdd); db.SaveChanges(); } }
/* * public int getAllUsersFromTheSameGender(char gender) * {//get all the users from the same gender 'F' = female or 'M'=male - aware\unaware candidates and all the students * return getAllCandidatesFromTheSameGender(gender).Count + getAllStudentsFromTheSameGender(gender).Count; * }*/ /*Add functions*/ public static void addUserToUsers(userTbl user, List <userTbl> users) { using (var db = new HeznekDB()) { db.userTbl.Add(user); db.SaveChanges(); } }