protected void btnInssuance_Click(object sender, EventArgs e) { tb_Speak speak = new tb_Speak(); speak.Speakman = Session["UserName"].ToString(); speak.TutorialType = "Sound"; speak.TutorialID = Convert.ToInt32(Request.Params["SoundID"]); speak.SpeakContent = txtContainer.Text; speakb.addSpeak(speak); }
protected void btnSpeak_Click(object sender, EventArgs e) { if (txtCheck.Text==Session["ValidateCode"].ToString()) { if (Request.Params["TutorialType"] == "Sound") { tb_Speak speak = new tb_Speak(); speak.Speakman = Session["UserName"].ToString(); speak.TutorialType = "Sound"; speak.TutorialID = Convert.ToInt32(Request.Params["TutorialID"]); speak.SpeakContent = txtLeaveContent.Text; if (speakb.addSpeak(speak) > 0) { Response.Write("<script>alert('发言成功')</script>"); } else { Response.Write("<script>alert('发言失败')</script>"); } gvBind(); } else { tb_Speak speak = new tb_Speak(); speak.Speakman = Session["UserName"].ToString(); speak.TutorialType = "Video"; speak.TutorialID = Convert.ToInt32(Request.Params["TutorialID"]); speak.SpeakContent = txtLeaveContent.Text; if (speakb.addSpeak(speak)>0) { Response.Write("<script>alert('发言成功')</script>"); } else { Response.Write("<script>alert('发言失败')</script>"); } gvBind(); } } else { Response.Write("<script>alert('验证码错误!')</script>"); Response.AddHeader("Refresh", "0"); } }
public List<tb_Speak> selPagingSpeak(string TableName, int TutorialID, int pageIndex, int pageSize) { tb_Speak Speak = null; DataSet list = sqlDal.sqlProcDs("GETSPEAKTABLEPAGE", new string[] { "@TABLENAME", "@TutorialID", "@PAGEINDEX", "@PAGESIZE" }, new string[] { TableName, TutorialID.ToString(), pageIndex.ToString(), pageSize.ToString() }); List<tb_Speak> speakList = new List<tb_Speak>(); foreach (DataRow obj in list.Tables[0].Rows) { Speak = new tb_Speak(); Speak.SpeakID = Convert.ToInt32(obj[0]); Speak.Speakman = obj[1].ToString(); Speak.SpeakDate = Convert.ToDateTime(obj[5]); Speak.SpeakContent = obj[4].ToString(); speakList.Add(Speak); } return speakList; }
public int addSpeak(tb_Speak speak) { return sd.addSpeak(speak); }
public int addSpeak(tb_Speak speak) { return sqlDal.sqlUpdate("insert into tb_Speak(Speakman,TutorialType,TutorialID,SpeakContent) values(@Speakman,@TutorialType,@TutorialID,@SpeakContent)", new string[] { "@Speakman","@TutorialType","@TutorialID","@SpeakContent" }, new string[] { speak.Speakman, speak.TutorialType, speak.TutorialID.ToString(),speak.SpeakContent }); }