/// <summary> /// MOOC 章发帖 /// </summary> /// <param name="model"></param> /// <returns></returns> public static OCMoocLive ForumTopic_Add(OCMoocLive model) { try { using (var conn = DbHelper.CCService()) { var p = new DynamicParameters(); p.Add("@TopicID", dbType: DbType.Int32, direction: ParameterDirection.Output); p.Add("@OCID", model.OCID); p.Add("@CourseID", 0); p.Add("@ForumTypeID", 0); p.Add("@GroupTaskID", 0); p.Add("@UserID", model.UserID); p.Add("@UserName", model.UserName); p.Add("@Title", model.ForumTitle); p.Add("@Conten", ""); p.Add("@TopicType", 2); p.Add("@Tags", ""); p.Add("@ChapterID", model.ChapterID); conn.Execute("ForumTopic_Add", p, commandType: CommandType.StoredProcedure); model.TopicID = p.Get<int>("TopicID"); return model; } } catch (Exception e) { return null; } }
/// <summary> /// 更改论题(MOOC) /// </summary> /// <param name="model"></param> /// <returns></returns> public bool ForumTopicTitle_Upd(OCMoocLive model) { return ForumTopicDAL.ForumTopicTitle_Upd(model); }
/// <summary> /// 编辑贴子(MOOC) /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool ForumTopicTitle_Upd(OCMoocLive model) { try { using (var conn = DbHelper.CCService()) { var p = new DynamicParameters(); p.Add("@TopicID", model.TopicID); p.Add("@Title", model.ForumTitle); conn.Execute("ForumTopicTitle_Upd", p, commandType: CommandType.StoredProcedure); return true; } } catch (Exception e) { return false; } }
/// <summary> /// 发帖 /// </summary> /// <param name="model"></param> /// <returns></returns> public OCMoocLive ForumTopic_Add(OCMoocLive model) { //model.UserID = UserService.CurrentUser.UserID; //model.UserName = UserService.CurrentUser.UserName; return ForumTopicDAL.ForumTopic_Add(model); }