예제 #1
0
 /// <summary>
 /// 保存评论
 /// </summary>
 /// <param name="m"></param>
 public static void save(Models.comment m)
 {
     using (DAL.commentDAL dal = new DAL.commentDAL())
     {
         dal.save(m);
     }
 }
 public void AddComment(int project_id, int user_id, string text)
 {
     Models.comment c = new Models.comment()
     {
         project_id = project_id,
         user_id    = user_id,
         text       = text
     };
     db.comments.Add(c);
     db.SaveChanges();
     // return View();
 }
예제 #3
0
파일: commentDAL.cs 프로젝트: newzl/examsou
        public void save(Models.comment m)
        {
            string sql = "insert into comment(eid,[sid],content,evaluate)values(@eid,@sid,@content,@evaluate)";

            SqlParameter[] pars =
            {
                new SqlParameter("@eid",      m.eid),
                new SqlParameter("@sid",      m.sid),
                new SqlParameter("@content",  m.content),
                new SqlParameter("@evaluate", m.evaluate)
            };
            SqlHelper.ExcuteNonQuery(sql, pars);
        }
예제 #4
0
        public void comment(FormCollection collection)
        {
            DoctorEntities dd  = new DoctorEntities();
            comment        com = new Models.comment();

            com.pid     = Session["email"].ToString();
            com.message = collection["message"];
            com.aid     = int.Parse(collection["aid"]);
            dd.comments.Add(com);
            dd.SaveChanges();



            Response.Redirect("Index");
        }
예제 #5
0
        public ActionResult comment(FormCollection collection)
        {
            DoctorEntities dd  = new DoctorEntities();
            comment        com = new Models.comment();

            com.regid   = Session["regid"].ToString();
            com.message = collection["message"];
            com.aid     = int.Parse(collection["aid"]);
            dd.comments.Add(com);
            dd.SaveChanges();



            return(View("DoctorLogin"));
        }
예제 #6
0
        public ActionResult Addcomment(int productid, string content)
        {
            var userId  = User.Identity.Name;
            var comment = new Models.comment()
            {
                ProductID  = productid,
                Contents   = content,
                UserId     = userId,
                CreateDate = DateTime.Now
            };

            using (farmarEntities1 db = new farmarEntities1())
            {
                db.comments.Add(comment);
                db.SaveChanges();
            }
            return(RedirectToAction("Details", new { id = productid }));
        }
예제 #7
0
 public int savecomment(Models.comment m)
 {
     m.eid = Utility.employeeLogin.eid;
     BLL.commentBLL.save(m);
     return(1);
 }