Ejemplo n.º 1
0
 /// <summary>
 /// 修改笔记
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateNoteByID(W_QuestionNote model, string StuId)
 {
     if (model.ID <= 0)
     {
         throw new ApiException("无效参数");
     }
     return(SqlMapper.Update("UpdateNoteByID", new { ID = model.ID, Remart = model.Remart, StuId = StuId }) > 0);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除题目下面所有的笔记
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool DeleteAllNote(W_QuestionNote model, string StuId)
 {
     if (model.Question_ID == 0)
     {
         throw new ApiException("无效参数");
     }
     return(SqlMapper.Delete("DeleteAllNote", new { Question_ID = model.Question_ID, StuId = StuId }) > 0);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据ID删除单条笔记
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool DeleteNoteByID(W_QuestionNote model, string StuId)
        {
            W_QuestionNote NoteModel = Orm.Single <W_QuestionNote>(x => x.ID == model.ID);

            if (NoteModel == null)
            {
                throw new ApiException("您要操作的数据不存在");
            }
            return(Orm.Delete <W_QuestionNote>(x => x.ID == model.ID) > 0);
        }
Ejemplo n.º 4
0
 public dynamic AddQuestionNote(W_QuestionNote model)
 {
     model.AddTime = DateTime.Now.ToString();
     model.StuID   = this.SafeGetStuId;
     return(Success(mapper.AddQuestionNote(model) ? "操作成功" : "操作失败"));
 }
Ejemplo n.º 5
0
 public dynamic UpdateNoteByID(W_QuestionNote model)
 {
     return(Success(mapper.UpdateNoteByID(model, this.SafeGetStuId)));
 }
Ejemplo n.º 6
0
 public dynamic DeleteAllNote(W_QuestionNote model)
 {
     return(Success(mapper.DeleteAllNote(model, this.SafeGetStuId)));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 添加笔记
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool AddQuestionNote(W_QuestionNote model)
 {
     return(Orm.Insert(model) > 0);
 }