コード例 #1
0
 /// <summary>
 /// Creates the specified Submission.
 /// </summary>
 /// <param name="student">The student.</param>
 /// <param name="topic">The topic.</param>
 /// <param name="uploadDate">The upload date.</param>
 /// <param name="Extension">Type of the MIME.</param>
 /// <param name="fileData">The file data.</param>
 public static void Create(Student student, Topic topic, Cours course, DateTime uploadDate, string Extension, string filePath)
 {
     Submission s = new Submission();
     s.Student = student;
     s.Cours = course;
     s.Topic = topic;
     s.UploadDate = uploadDate;
     s.Extension = Extension;
     s.FilePath = filePath.Trim();
     db.Submissions.AddObject(s);
     db.SaveChanges();
 }
コード例 #2
0
 /// <summary>
 /// Create a new Submission object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="studentID">Initial value of the StudentID property.</param>
 /// <param name="courseID">Initial value of the CourseID property.</param>
 /// <param name="topicID">Initial value of the TopicID property.</param>
 /// <param name="uploadDate">Initial value of the UploadDate property.</param>
 /// <param name="extension">Initial value of the Extension property.</param>
 public static Submission CreateSubmission(global::System.Int32 id, global::System.Int32 studentID, global::System.Int32 courseID, global::System.Int32 topicID, global::System.DateTime uploadDate, global::System.String extension)
 {
     Submission submission = new Submission();
     submission.ID = id;
     submission.StudentID = studentID;
     submission.CourseID = courseID;
     submission.TopicID = topicID;
     submission.UploadDate = uploadDate;
     submission.Extension = extension;
     return submission;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Submissions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSubmissions(Submission submission)
 {
     base.AddObject("Submissions", submission);
 }
コード例 #4
0
 /// <summary>
 /// Adds submission to topic.
 /// </summary>
 /// <param name="topic">The topic.</param>
 /// <param name="submission">The submission.</param>
 public static void AddToTopic(Topic topic, Submission submission)
 {
     submission.Topic = topic;
     db.SaveChanges();
 }
コード例 #5
0
 /// <summary>
 /// Updates the specified submission.
 /// </summary>
 /// <param name="submission">The submission.</param>
 /// <param name="uploadDate">The upload date.</param>
 /// <param name="fileType">Type of the file.</param>
 public static void Update(Submission submission, DateTime uploadDate, string fileType)
 {
     submission.UploadDate = uploadDate;
     submission.Extension = fileType;
     db.SaveChanges();
 }