/// <summary> /// 留言 /// </summary> /// <returns></returns> public string AddMsg() { string json = ""; string mCode = Request1.GetF("mCode"); string content = Request1.GetF("content"); if (mCode != "" && content != "") { xm_Msg msg = new xm_Msg(); msg.mCode = mCode; msg.mContent = content; msg.mState = 0; msg.mTime = DateTime.Now; db.AddToxm_Msg(msg); db.SaveChanges(); json = "{\"data_relult\":\"1\",\"data_msg\":\"添加成功!\"}"; } else { json = "{\"data_relult\":\"0\",\"data_msg\":\"留言内容不能为空!\"}"; } return(json); }
public void DelVoteById(RepeaterCommandEventArgs e) { int id = Convert.ToInt32(e.CommandArgument.ToString().Trim()); xm_Msg vote = (from a in db.xm_Msg where a.mId == id select a ).FirstOrDefault(); if (vote != null) { db.DeleteObject(vote); db.SaveChanges(); LoadPrizeData(); } }