public CCtblEvent[] ReadEventList()
 {
     using (ist420grp7Entities entities = new ist420grp7Entities())
     {
         var events = from s in entities.CCtblEvents select s;
         return(events.ToArray());
     }
 }
 public CCtblUser ReadUser(int UserID)
 {
     using (ist420grp7Entities entities = new ist420grp7Entities())
     {
         CCtblUser stud = new CCtblUser();
         stud = entities.CCtblUsers.Find(UserID);
         return(stud);
     }
 }
 public string CreateGuestPost(CCtblGuestLookUp guest)
 {
     using (ist420grp7Entities entities = new ist420grp7Entities())
     {
         entities.CCtblGuestLookUps.Add(guest);
         entities.SaveChanges();
         if (guest.fldEntryNo > 0)
         {
             return(guest.fldEntryNo.ToString());
         }
         else
         {
             return("false");
         }
     }
 }
 public string CreateUserPost(CCtblUser CreateUser)
 {
     //try
     //{
     using (ist420grp7Entities entities = new ist420grp7Entities())
     {
         entities.CCtblUsers.Add(CreateUser);
         entities.SaveChanges();
         if (CreateUser.fldUserNo > 0)
         {
             return(CreateUser.fldUserNo.ToString());
         }
         else
         {
             return("false");
         }
     }
 }
 public bool DeleteEvent(int EventID)
 {
     using (ist420grp7Entities entities = new ist420grp7Entities())
     {
         //Create the student stud object
         CCtblEvent User = new CCtblEvent();
         try
         {
             User = entities.CCtblEvents.Find(EventID);
             //Delete a record
             entities.CCtblEvents.Remove(User);
             entities.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }