public ActionResult UpdateView(int id) { List <T_Marquee> list = this._con.GetMarqueeList(); T_Marquee con = list.Where(w => w.id == id).FirstOrDefault(); return(View(con)); }
public ActionResult SaveData(T_Marquee model) { model.updateTime = System.DateTime.Now; model.content = model.content == null ? " " : model.content; int result = this._con.UpdateMarquee(model); return(Response(result)); }
/// <summary> /// 修改数据 /// </summary> /// <param name="con"></param> /// <returns></returns> public int UpdateMarquee(T_Marquee con) { using (IDbConnection conn = DapperAdapter.MySQLOpenConnection(ConfigurationHelper.MySQLConnectionStr)) { string sql = "UPDATE t_marquee SET content=@content,voild=@voild,pId=@pId,updateTime=@updateTime where id=@id;"; return(conn.Execute(sql, con)); } }