Exemplo n.º 1
0
 protected void btnreply_Click(object sender, EventArgs e)
 {
     if (Session["user_name"] != null)
     {
         if (Page.IsValid)
         {
             Button            btn   = (Button)sender;
             string            a     = ((TextBox)btn.Parent.FindControl("txtreply")).Text.Trim();
             travel_comt_reply reply = new travel_comt_reply();
             reply.trcomt_id  = Int32.Parse((btn.Parent.FindControl("HiddenFieldComID") as HiddenField).Value);
             reply.user_id    = int.Parse(Session["user_id"].ToString());
             reply.reply_cont = ((TextBox)btn.Parent.FindControl("txtreply")).Text.Trim();
             reply.reply_time = DateTime.Now;
             int result = Travel_comt_replyManager.InsertTravel_re(reply);
             if (result >= 1)
             {
                 ScriptManager.RegisterClientScriptBlock(updatereply, this.GetType(), "click", "alert('回复成功!')", true);
                 BindTravelComment();
                 txtComments.Text = "";
             }
             else
             {
                 ScriptManager.RegisterClientScriptBlock(updatereply, this.GetType(), "click", "alert('回复失败!')", true);
             }
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(updatereply, this.GetType(), "click", "alert('您必须先登录才能回复!')", true);
         ScriptManager.RegisterStartupScript(updatereply, updatereply.GetType(), "updateScript", "window.location.href='login1.aspx'", true);
     }
 }
Exemplo n.º 2
0
        public int InsertTravel_re(travel_comt_reply travel_Comt_Reply)
        {
            string sql = "insert into travel_comt_reply(trcomt_id,user_id,reply_cont,reply_time) values(@trcomt_id,@user_id,@reply_cont,@reply_time)";

            SqlParameter[] sp =
            {
                new SqlParameter("@trcomt_id",  travel_Comt_Reply.trcomt_id),
                new SqlParameter("@user_id",    travel_Comt_Reply.user_id),
                new SqlParameter("@reply_cont", travel_Comt_Reply.reply_cont),
                new SqlParameter("@reply_time", travel_Comt_Reply.reply_time)
            };
            return(DBHelper.GetExcuteNonQuery(sql, sp));
        }
Exemplo n.º 3
0
 public static int InsertTravel_re(travel_comt_reply travel_Comt_Reply)
 {
     return(itravel_Comt_Reply.InsertTravel_re(travel_Comt_Reply));
 }