/// <summary>
 /// 编辑[我的笔记]
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ActionResult EditContentNote(Member_ClassContentNote model)
 {
     var memberBll = new Member_ClassContentNoteBLL();
     if (model.Id == 0)//新增
     {
         if (memberBll.Add(model))
         {
             return Json(new { Result = true, Msg = "新增成功!" }, JsonRequestBehavior.AllowGet);
         }
         else
         {
             return Json(new { Result = true, Msg = "新增失败!" }, JsonRequestBehavior.AllowGet);
         }
     }
     else//修改
     {
         model.CreateDate = DateTime.Now;
         if (memberBll.Update(model))
         {
             return Json(new { Result = true, Msg = "修改成功!" }, JsonRequestBehavior.AllowGet);
         }
         else
         {
             return Json(new { Result = true, Msg = "修改失败!" }, JsonRequestBehavior.AllowGet);
         }
     }
 }
        /// <summary>
        /// 删除[我的笔记]
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult DelContentNote(Member_ClassContentNote model)
        {
            var memberBll = new Member_ClassContentNoteBLL();

            if (memberBll.Delete(model))
            {
                return Json(new { Result = true, Msg = "删除成功!" }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json(new { Result = false, Msg = "删除失败!" }, JsonRequestBehavior.AllowGet);
            }
        }
 public List<LearnNoteInfo> GetNotesInfoById(int Id)
 {
     Member_ClassContentNoteBLL bll = new Member_ClassContentNoteBLL();
     return bll.GetNotesInfoById(Id);
 }
 public Member_ClassContentNote GetNotesInfoByNoteId(int Id)
 {
     Member_ClassContentNoteBLL bll = new Member_ClassContentNoteBLL();
     return bll.GetModel(Id, "delflag = 0");
 }
        /// <summary>
        /// 获取我的笔记信息
        /// </summary>
        /// <returns></returns>
        private List<Member_ClassContentNote> GetReadingNoteList(int TrainingId, int ClassId, int iUnitContentId, bool IsNeedPaging = true)
        {
            var memberBll = new Member_ClassContentNoteBLL();
            var List_Member_ClassContentNote = new List<Member_ClassContentNote>();
            var stbSqlWhere = new StringBuilder();

            //与课程TrainingId,班级ClassId,活动UnitContent,用户AccountId进行绑定
            int iAccountId = 0;

            iAccountId = Code.SiteCache.Instance.LoginInfo.UserId;

            stbSqlWhere.Append("Delflag = 0");
            stbSqlWhere.Append("AND ClassId = " + ClassId);
            stbSqlWhere.Append("AND TrainingId = " + TrainingId);
            stbSqlWhere.Append("AND AccountId = " + iAccountId);
            stbSqlWhere.Append("AND UnitContent = " + iUnitContentId);

            //获取[我的笔记]总条数
            int iRecordCount = memberBll.GetMemberClassContentNoteCount(stbSqlWhere.ToString());
            int iPageSize = 4, iPageIndex = 0;
            int iPageCount = (int)Math.Ceiling((double)iRecordCount / iPageSize);
            if (!string.IsNullOrEmpty(Request["PageIndex"]))
            {
                int.TryParse(QueryString.Decrypt(Request["PageIndex"]), out iPageIndex);
            }
            if (iPageIndex < 1)
                iPageIndex = 1;
            else if (iPageIndex > iPageCount)
                iPageIndex = iPageCount;
            if (IsNeedPaging)
            {
                //获取分页数据集合
                List_Member_ClassContentNote = memberBll.GetList(iPageSize, iPageIndex, stbSqlWhere.ToString(), "CreateDate", out iRecordCount);
            }
            else
            {
                List_Member_ClassContentNote = memberBll.GetList(stbSqlWhere.ToString(), "CreateDate");
            }

            ViewBag.ClassId = ClassId;
            ViewBag.TrainingId = TrainingId;
            ViewBag.AccountId = iAccountId;
            ViewBag.UnitContent = iUnitContentId;
            ViewBag.RecordCount = iRecordCount;
            ViewBag.PageCount = iPageCount;
            ViewBag.PageIndex = iPageIndex;
            ViewBag.PageSize = iPageSize;

            return List_Member_ClassContentNote;
        }