Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 public int AddSee(int cid)
 {
     try
     {
         ContentDAL dal = new ContentDAL();
         return(dal.AddSee(cid));
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 3
0
 /// <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;
     }
 }
Ejemplo n.º 4
0
 public int FanDui(int commentId, int userId)
 {
     try
     {
         ContentDAL dal = new ContentDAL();
         return(dal.FanDui(commentId, userId));
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
 /// <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;
     }
 }
Ejemplo n.º 6
0
 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;
     }
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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);
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
        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);
 }
Ejemplo n.º 22
0
        public static List <EC_Content> GetContentbyType(int type, int take)
        {
            ContentDAL contentDal = new ContentDAL();

            return(contentDal.GetAllContentByType(type).Take(take).ToList());
        }
Ejemplo n.º 23
0
        public static EC_DetailContent GetContentbyIdParent(int Id)
        {
            ContentDAL contentDal = new ContentDAL();

            return(contentDal.GetContentbyIdParent(Id));
        }
Ejemplo n.º 24
0
        public static List <EC_Content> GetLastContent(int take)
        {
            ContentDAL contentDal = new ContentDAL();

            return(contentDal.GetAllContent().Take(take).ToList());
        }
Ejemplo n.º 25
0
        public static List <EC_Content> getAllContentByType(int type)
        {
            ContentDAL contentDal = new ContentDAL();

            return(contentDal.GetAllContentByType(type));
        }
Ejemplo n.º 26
0
        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);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 新增类别
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public int AddType(string name)
        {
            ContentDAL dal = new ContentDAL();

            return(dal.AddType(name));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 检查标签是否存在
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool ChekcLabel(string name)
        {
            ContentDAL dal = new ContentDAL();

            return(dal.CheckLabel(name));
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 新增标签
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public int AddLabel(string name)
        {
            ContentDAL dal = new ContentDAL();

            return(dal.AddLabel(name));
        }
Ejemplo n.º 30
0
        /// <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));
        }