public ContentPageModel <Mldel.Contents.CommentModel> GetCommentPageList(int cid, int pageIndex, int pageSize, int userId) { try { ContentDAL dal = new ContentDAL(); return(dal.GetCommentPageList(cid, pageIndex, pageSize, userId)); } catch (Exception) { throw; } }
public int AddSee(int cid) { try { ContentDAL dal = new ContentDAL(); return(dal.AddSee(cid)); } catch (Exception) { throw; } }
/// <summary> /// 用户评论 /// </summary> /// <param name="model"></param> /// <returns></returns> public int PingLunTiTiao(Mldel.Contents.CommentModel model) { try { ContentDAL dal = new ContentDAL(); return(dal.PingLunTiTiao(model)); } catch (Exception) { throw; } }
public int FanDui(int commentId, int userId) { try { ContentDAL dal = new ContentDAL(); return(dal.FanDui(commentId, userId)); } catch (Exception) { throw; } }
/// <summary> /// 删除文章方法 /// </summary> /// <param name="id"></param> /// <returns></returns> public int DeleteContent(int id) { try { ContentDAL dal = new ContentDAL(); return(dal.DeleteContent(id)); } catch (Exception) { throw; } }
public List <ContentModel> GetContentList(string search, int pageIndex, int pageSize, int ContenttypeId, out int count) { try { ContentDAL dal = new ContentDAL(); return(dal.GetContentList(search, pageIndex, pageSize, ContenttypeId, out count)); } catch (Exception) { throw; } }
public static DataSet GetQuestionAnswer(int action, int CompID, int QuestionID, string UserID) { DataSet ds = new DataSet(); try { ds = ContentDAL.GetQuestionAnswer(action, CompID, QuestionID, UserID); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet GetModules(int action, ContentBO content) { DataSet ds = new DataSet(); try { ds = ContentDAL.GetModules(action, content); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet UpdateCourseTime(int Action, int TopicID, int IsPublished) { DataSet ds = new DataSet(); try { ds = ContentDAL.UpdateCourseTime(Action, TopicID, IsPublished); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet AssignTopics(ContentBO content) { DataSet ds = new DataSet(); try { ds = ContentDAL.AssignTopics(content); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet DeleteTopic(ContentBO content, int Action) { DataSet ds = new DataSet(); try { ds = ContentDAL.DeleteTopic(content, Action); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet DeleteAnswer(int compId, string userId, int AnswerID, int IsActive) { DataSet ds = new DataSet(); try { ds = ContentDAL.DeleteAnswer(compId, userId, AnswerID, IsActive); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet QuizCRUD(int action, int CompID, string UserID, int TopicID, int ModuleID, string Description) { DataSet ds = new DataSet(); try { ds = ContentDAL.QuizCRUD(action, CompID, UserID, TopicID, ModuleID, Description); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet EditModules(int compid, string userid, string Role, string topicid, string moduleid) { DataSet ds = new DataSet(); try { ds = ContentDAL.EditModules(compid, userid, Role, topicid, moduleid); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet BindCourseCategory(int compid, string userid, string Role) { DataSet ds = new DataSet(); try { ds = ContentDAL.BindCourseCategory(compid, userid, Role); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet ReorderContent(int compid, string userid, int type, string ids) { DataSet ds = new DataSet(); try { ds = ContentDAL.ReorderContent(compid, userid, type, ids); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet ModifyTopic(ContentBO content) { DataSet ds = new DataSet(); try { ds = ContentDAL.CreateTopic(Convert.ToInt32(ConstantMessages.Action.MODIFY), content); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet CreateContent(ContentBO content) { DataSet ds = new DataSet(); try { ds = ContentDAL.CreateContent((int)ConstantMessages.Action.INSERT, content); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static DataSet IsCoursePublishable(int CompID, int TopicID) { DataSet ds = new DataSet(); try { ds = ContentDAL.IsCoursePublishable(CompID, TopicID); } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
public static Serie GetSerieFromContent(int IdSerie) { ContentDAL contentDal = new ContentDAL(); Serie serie = new Serie(); var serietmp = contentDal.GetContentById(IdSerie); var childseries = contentDal.GetAllContentByParent(IdSerie); if (serietmp != null) { serie.autor = serietmp.EC_Users.Username; serie.Description = serietmp.Description; serie.Id = serietmp.Id; serie.image = serietmp.thumbail; serie.title = serietmp.Title; serie.series = childseries; } return(serie); }
private void LoadSettings() { this.contentSettings = ContentDAL.GetContentConfiguration(ProgramId); }
public static List <EC_Content> GetContentbyType(int type, int take) { ContentDAL contentDal = new ContentDAL(); return(contentDal.GetAllContentByType(type).Take(take).ToList()); }
public static EC_DetailContent GetContentbyIdParent(int Id) { ContentDAL contentDal = new ContentDAL(); return(contentDal.GetContentbyIdParent(Id)); }
public static List <EC_Content> GetLastContent(int take) { ContentDAL contentDal = new ContentDAL(); return(contentDal.GetAllContent().Take(take).ToList()); }
public static List <EC_Content> getAllContentByType(int type) { ContentDAL contentDal = new ContentDAL(); return(contentDal.GetAllContentByType(type)); }
public static DataSet GetContentList_Formatted(ContentBO content, ref List <ContentBO> lstContent) { DataSet ds = new DataSet(); try { ds = ContentDAL.GetContentList(content); lstContent = new List <ContentBO>(); lstContent = (from DataRow dr in ds.Tables[0].Rows select new ContentBO() { ContentID = Convert.ToInt32(Convert.ToString(dr["ContentID"])), Title = Convert.ToString(dr["Title"]), SrNo = Convert.ToInt32(Convert.ToString(dr["SrNo"])), Description = Convert.ToString(dr["Description"]), Points = !string.IsNullOrEmpty(dr["Points"].ToString()) ? Convert.ToDouble(dr["Points"].ToString()) : 0, IntroTitle = Convert.ToString(dr["FlashcardTitle"]), QuizCount = Convert.ToInt32(Convert.ToString(dr["QuizCount"])), IsPublished = !string.IsNullOrEmpty(dr["IsPublished"].ToString()) ? Convert.ToBoolean(Convert.ToInt32(dr["IsPublished"].ToString())) : true, IsGift = !string.IsNullOrEmpty(dr["IsGift"].ToString()) ? Convert.ToBoolean(Convert.ToInt32(dr["IsGift"].ToString())) : true, IsSkipFlashcards = !string.IsNullOrEmpty(dr["SkipFlashcards"].ToString()) ? Convert.ToBoolean(Convert.ToInt32(dr["SkipFlashcards"].ToString())) : true, TotalScore = !string.IsNullOrEmpty(dr["TotalScore"].ToString()) ? Convert.ToDouble(dr["TotalScore"].ToString()) : 0, PassingScore = !string.IsNullOrEmpty(dr["PassingScore"].ToString()) ? Convert.ToDouble(dr["PassingScore"].ToString()) : 0, PassingPercent = !string.IsNullOrEmpty(dr["PassingPercent"].ToString()) ? Convert.ToDouble(dr["PassingPercent"].ToString()) : 0, ContentType = Convert.ToString(dr["Type"]) }).ToList(); List <FlashcarIntro> lstFlashcarIntro = new List <FlashcarIntro>(); lstFlashcarIntro = (from DataRow dr in ds.Tables[1].Rows select new FlashcarIntro() { ContentID = Convert.ToInt32(Convert.ToString(dr["ContentID"])), SrNo = Convert.ToInt32(Convert.ToString(dr["SrNo"])), ID = Convert.ToInt32(Convert.ToString(dr["ID"])), Comments = Convert.ToString(dr["Comments"]) }).ToList(); List <FlashcardSlides> lstFlashcardSlides = new List <FlashcardSlides>(); lstFlashcardSlides = (from DataRow dr in ds.Tables[2].Rows select new FlashcardSlides() { ContentID = Convert.ToInt32(Convert.ToString(dr["ContentID"])), SrNo = Convert.ToInt32(Convert.ToString(dr["SrNo"])), FlashcardID = Convert.ToInt32(Convert.ToString(dr["FlashcardID"])), Title = Convert.ToString(dr["Title"]), Description = Convert.ToString(dr["Description"]) }).ToList(); var questionList = new List <Question>(); questionList = (from DataRow dr in ds.Tables[3].Rows select new Question() { ContentID = Convert.ToInt32(Convert.ToString(dr["ContentID"])), QuestionID = Convert.ToInt32(dr["QuestionID"]), Title = dr["Title"].ToString(), SortOrder = Convert.ToInt32(dr["SrNo"].ToString()), QType = dr["QuestionType"].ToString(), QuestionTypeID = Convert.ToInt32(dr["QuestionTypeID"].ToString()), IsBox = !string.IsNullOrEmpty(dr["IsBox"].ToString()) ? Convert.ToBoolean(Convert.ToInt32(dr["IsBox"].ToString())) : true }).ToList(); List <AnswerOption> ansOptionList = new List <AnswerOption>(); ansOptionList = (from DataRow dr in ds.Tables[4].Rows select new AnswerOption() { QuestionID = !string.IsNullOrEmpty(dr["QuestionID"].ToString()) ? Convert.ToInt32(dr["QuestionID"].ToString()) : 0, SortOrder = !string.IsNullOrEmpty(dr["SrNo"].ToString()) ? Convert.ToInt32(dr["SrNo"].ToString()) : 0, AnswerID = !string.IsNullOrEmpty(dr["AnswerID"].ToString()) ? Convert.ToInt32(dr["AnswerID"].ToString()) : 0, AnswerText = dr["AnswerText"].ToString(), IsCorrect = !string.IsNullOrEmpty(dr["IsCorrect"].ToString()) ? Convert.ToBoolean(Convert.ToInt32(dr["IsCorrect"].ToString())) : false, CorrectScore = !string.IsNullOrEmpty(dr["CorrectScore"].ToString()) ? Convert.ToDouble(dr["CorrectScore"].ToString()) : 0, }).ToList(); lstContent = lstContent.OrderBy(p => p.SrNo).ToList(); foreach (var _content in lstContent) { var questions = questionList.Where(p => p.ContentID == _content.ContentID).OrderBy(p => p.SortOrder).ToList(); _content.Questions = questions; _content.FlashcardIntro = lstFlashcarIntro.Where(p => p.ContentID == _content.ContentID).OrderBy(p => p.SrNo).ToList(); _content.FlashcardSlides = lstFlashcardSlides.Where(p => p.ContentID == _content.ContentID).OrderBy(p => p.SrNo).ToList(); foreach (var question in questions) { List <AnswerOption> ansOptions = new List <AnswerOption>(); question.AnswerOptions = ansOptionList.Where(p => p.QuestionID == question.QuestionID).OrderBy(p => p.SortOrder).ToList(); if (question.AnswerOptions.Count() > 0) { if (question.QuestionTypeID == 2 || question.QuestionTypeID == 3) { question.TotalScore = question.AnswerOptions.Max(p => p.CorrectScore); } else if (question.QuestionTypeID == 1) { question.TotalScore = question.AnswerOptions.Where(p => p.IsCorrect == true).Sum(p => p.CorrectScore); } } } } } catch (Exception ex) { Log(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } return(ds); }
/// <summary> /// 新增类别 /// </summary> /// <param name="name"></param> /// <returns></returns> public int AddType(string name) { ContentDAL dal = new ContentDAL(); return(dal.AddType(name)); }
/// <summary> /// 检查标签是否存在 /// </summary> /// <param name="name"></param> /// <returns></returns> public bool ChekcLabel(string name) { ContentDAL dal = new ContentDAL(); return(dal.CheckLabel(name)); }
/// <summary> /// 新增标签 /// </summary> /// <param name="name"></param> /// <returns></returns> public int AddLabel(string name) { ContentDAL dal = new ContentDAL(); return(dal.AddLabel(name)); }
/// <summary> /// 修改类别 /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <returns></returns> public int UpdateType(int id, string name) { ContentDAL dal = new ContentDAL(); return(dal.UpdateType(id, name)); }