public TaskCommentExtended(int task_comment_id, int user_id) { TaskCommentCallerID = user_id; TaskCommentID = task_comment_id; if (task_comment_id != 0) { task_comment _task_comment_original = db.task_comment.Where(item => item.id == task_comment_id).FirstOrDefault(); _taskComment = _task_comment_original; if (_taskComment.id != 0) { _parentTask = new TaskExtended(_taskComment.task_id, user_id); } if (_task_comment_original.user_id != 0) { UserModel temp_user = new UserModel(_task_comment_original.user_id); if (temp_user._user.photo_path.Trim().Length > 0) { PosterPath = temp_user._user.photo_path; } } } }
public ActionResult Task([Bind(Include = "body,task_id,user_id")] task_comment newTask) { newTask.created_date = DateTime.Now; newTask.title = ""; if (ModelState.IsValid) { db.task_comment.Add(newTask); try { db.SaveChanges(); /// glb.UpdateReportLog(newMessage.sender_id, 7, newMessage.report_id, "", null, ""); } catch (Exception ex) { logger.Error(ex.ToString()); return(View()); } return(RedirectToAction("Task/" + newTask.task_id.ToString())); } return(View()); }