示例#1
0
        /// <summary>
        /// 回复课前建议
        /// </summary>
        /// <param name="id"></param>
        /// <param name="CourseId"></param>
        /// <param name="AnserContent"></param>
        /// <returns></returns>
        public JsonResult ReplyCl_CourseAdvice(int id, int CourseId, string AnserContent, int VisibleFlag)
        {
            Cl_CourseAdvice model = new Cl_CourseAdvice();

            model.Id           = id;
            model.CourseId     = CourseId;
            model.AnserContent = AnserContent;
            model.AnserTime    = DateTime.Now;
            model.VisibleFlag  = VisibleFlag;

            if (ClCourseAdviceBL.ReplyCl_CourseAdvice(model))
            {
                string html = "";
                html += "<div>";
                html += "<p><strong class='c_col'>讲师:<span>" + CurrentUser.Realname + "</span>反馈内容:</strong>" + model.AnserContent + "</p>";
                html += "<p>时间:" + model.AnserTime + "</p>";
                html += "</div>";

                return(Json(new
                {
                    result = 0,
                    innerhtml = html,
                    content = "反馈成功"
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new
                {
                    result = 0,
                    content = "反馈失败"
                }, JsonRequestBehavior.AllowGet));
            }
        }
示例#2
0
 /// <summary>
 /// 添加课前建议
 /// </summary>
 /// <param name="model"></param>
 public void SubmitCl_CourseAdvice(Cl_CourseAdvice model)
 {
     using (IDbConnection connection = OpenConnection())
     {
         string sql   = "insert into Cl_CourseAdvice (CourseId,UserId,AdviceContent,AdviceTime,VisibleFlag,IsDelete) values(@CourseId,@UserId,@AdviceContent,@AdviceTime,@VisibleFlag,@IsDelete)";
         var    param = new
         {
             model.CourseId,
             model.UserId,
             model.AdviceContent,
             model.AdviceTime,
             model.VisibleFlag,
             model.IsDelete
         };
         decimal id = connection.Query <decimal>(sql, param).FirstOrDefault();
         model.Id = decimal.ToInt32(id);
     }
 }
示例#3
0
        /// <summary>
        /// 回复课前建议
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ReplyCl_CourseAdvice(Cl_CourseAdvice model)
        {
            using (IDbConnection connection = OpenConnection())
            {
                string sql   = "update Cl_CourseAdvice set AnserUserId=@AnserUserId,AnserContent=@AnserContent,AnserTime=@AnserTime,VisibleFlag=@VisibleFlag where CourseId=@CourseId and Id=@Id ";
                var    param = new
                {
                    model.AnserUserId,
                    model.AnserContent,
                    model.AnserTime,
                    model.CourseId,
                    model.VisibleFlag,
                    model.Id
                };

                int result = connection.Execute(sql, param);
                return(result > 0);
            }
        }
示例#4
0
 public bool ReplyCl_CourseAdvice(Cl_CourseAdvice model)
 {
     return(clCourseAdviceDb.ReplyCl_CourseAdvice(model));
 }
示例#5
0
 public void SubmitCl_CourseAdvice(Cl_CourseAdvice model)
 {
     clCourseAdviceDb.SubmitCl_CourseAdvice(model);
 }