/// <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(); }
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); }
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"); }
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")); }
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 })); }
public int savecomment(Models.comment m) { m.eid = Utility.employeeLogin.eid; BLL.commentBLL.save(m); return(1); }