Example #1
0
 /*Add function*/
 public static void addBankToList(bank bank)
 {
     using (var db = new HeznekDB())
     {
         db.bank.Add(bank);
         db.SaveChanges();
     }
 }
Example #2
0
        /* 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();
            }
        }
Example #3
0
        /*
         * 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();
            }
        }