Ejemplo n.º 1
0
 public ActionResult CommentContestPartial(int ContestID)
 {
     Comment comment = new Comment();
     comment.SystemObjectRecordID = ContestID;
     comment.SystemObjectID = db.SystemObjects.FirstOrDefault(s => s.Name == "Contests").SystemObjectID;
     return PartialView("CommentContestPartial", comment);
 }
Ejemplo n.º 2
0
 public ActionResult CommentSubmitPartial(int SubmitID)
 {
     Comment comment = new Comment();
     comment.SystemObjectRecordID = SubmitID;
     comment.SystemObjectID = db.SystemObjects.FirstOrDefault(s => s.Name == "Student_Submit").SystemObjectID;
     return PartialView("CommentSubmitPartial", comment);
 }
Ejemplo n.º 3
0
        public ActionResult CommentContestPartial(Comment comment)
        {
            if (comment.Body != "")
            {
                comment.CommentByAccountID = User.Identity.Name;
                commentBL.SaveComment(comment);
                commentBL.SaveChange();

            }

            Comment comment2 = new Comment();
            comment2.SystemObjectRecordID = comment.SystemObjectRecordID;
            comment2.SystemObjectID = db.SystemObjects.FirstOrDefault(s => s.Name == "Contests").SystemObjectID; ;
            comment2.Body = "không có gì";
            return PartialView("CommentContestPartial", comment2);
        }
Ejemplo n.º 4
0
 public bool SaveComment(Comment comment)
 {
     try
     {
         BeginChange();
         comment.CreateDate = DateTime.Now;
         db.Comments.AddObject(comment);
         CommitChange();
         return true;
     }
     catch (Exception ex)
     {
         LogUtility.WriteLog(ex);
         RollbackChange();
         return false;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Comments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToComments(Comment comment)
 {
     base.AddObject("Comments", comment);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Create a new Comment object.
 /// </summary>
 /// <param name="commentID">Initial value of the CommentID property.</param>
 /// <param name="systemObjectRecordID">Initial value of the SystemObjectRecordID property.</param>
 /// <param name="timestamp">Initial value of the Timestamp property.</param>
 /// <param name="body">Initial value of the Body property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 /// <param name="commentByAccountID">Initial value of the CommentByAccountID property.</param>
 /// <param name="systemObjectID">Initial value of the SystemObjectID property.</param>
 /// <param name="isDelete">Initial value of the IsDelete property.</param>
 public static Comment CreateComment(global::System.Int32 commentID, global::System.Int32 systemObjectRecordID, global::System.Byte[] timestamp, global::System.String body, global::System.DateTime createDate, global::System.String commentByAccountID, global::System.Int32 systemObjectID, global::System.Boolean isDelete)
 {
     Comment comment = new Comment();
     comment.CommentID = commentID;
     comment.SystemObjectRecordID = systemObjectRecordID;
     comment.Timestamp = timestamp;
     comment.Body = body;
     comment.CreateDate = createDate;
     comment.CommentByAccountID = commentByAccountID;
     comment.SystemObjectID = systemObjectID;
     comment.IsDelete = isDelete;
     return comment;
 }
Ejemplo n.º 7
0
 public ActionResult CommentProblemPartial(Comment comment)
 {
     if (comment.Body != "")
     {
         comment.CommentByAccountID = User.Identity.Name;
         commentBL.SaveComment(comment);
         commentBL.SaveChange();
         Problem p = problemBL.LayTheoMa(comment.SystemObjectRecordID);
     }
     //return RedirectToAction("Details", "Problem", new { ID = p.ID });// PartialView("GridviewPartial", comment);
     Comment comment2 = new Comment();
     comment2.SystemObjectRecordID = comment.SystemObjectRecordID;
     comment2.SystemObjectID = comment.SystemObjectID;
     comment2.Body = "";
     return PartialView("CommentProblemPartial", comment2);
 }