コード例 #1
0
 public static void AddForumTopic(Forum forum)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.Forum.Add(forum);
         context.SaveChanges();
     }
 }
コード例 #2
0
 public static void AddCourse(Course course)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.Course.Add(course);
         context.SaveChanges();
     }
 }
コード例 #3
0
 public static void AddForumEntry(ForumEntries forumentry)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.ForumEntries.Add(forumentry);
         context.SaveChanges();
     }
 }
コード例 #4
0
 public static bool AddSchedule(Schedule v)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.Schedule.Add(v);
         context.SaveChanges();
         return(true);
     }
 }
コード例 #5
0
 public static bool AddVacationDay(Vacation v)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.Vacation.Add(v);
         context.SaveChanges();
         return(true);
     }
 }
コード例 #6
0
 public static bool AddUser(User User)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         context.User.Add(User);
         context.SaveChanges();
         return(true);
     }
 }
コード例 #7
0
 public static bool SendMessage(Message msj)
 {
     using (VitaminEntities context = new VitaminEntities())
     {
         try
         {
             context.Message.Add(msj);
             context.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }