Пример #1
0
 public void Add(M_Feedback model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ParentId", SqlDbType.Int, 4), new SqlParameter("@title", SqlDbType.NVarChar), new SqlParameter("@author", SqlDbType.NVarChar), new SqlParameter("@reward", SqlDbType.Int, 4), new SqlParameter("@scoring", SqlDbType.Int, 4), new SqlParameter("@categoryId", SqlDbType.Int, 4), new SqlParameter("@content", SqlDbType.NText), new SqlParameter("@state", SqlDbType.Int, 4), new SqlParameter("@replyDate", SqlDbType.DateTime), new SqlParameter("@EndDate", SqlDbType.DateTime), new SqlParameter("@IP", SqlDbType.NVarChar) };
     commandParameters[0].Value = model.ParentId;
     commandParameters[1].Value = model.Title;
     commandParameters[2].Value = model.Author;
     commandParameters[3].Value = model.Reward;
     commandParameters[4].Value = model.Scoring;
     commandParameters[5].Value = model.CategoryId;
     commandParameters[6].Value = model.Content;
     commandParameters[7].Value = model.State;
     commandParameters[8].Value = model.ReplyDate;
     commandParameters[9].Value = model.EndDate;
     commandParameters[10].Value = model.Ip;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Feedback_Add", commandParameters);
 }
Пример #2
0
 protected void btnOk_Click(object sender, EventArgs e)
 {
     if (FId != 0)
     {
         if (txtReply.Text.Trim() == "")
         {
             Function.ShowMsg(0, "<li>回复内容不能为空</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
         }
         M_Feedback model = new M_Feedback();
         B_SiteInfo siteBll = new B_SiteInfo();
         model.Content = siteBll.GetFiltering(txtReply.Text);
         model.ParentId = FId;
         model.EndDate = model.ReplyDate = DateTime.Now;
         model.Ip = Request.UserHostAddress;
         model.Author = user.GetCookie().LogName;
         model.Title = "";
         model.CategoryId = Convert.ToInt32(feedback.GetFeedback(FId).Tables[0].Rows[0]["CategoryId"]);
         model.State = 0;
         feedback.Add(model);
         txtReply.Text = "";
         Response.Redirect("MyFeedback.aspx");
     }
 }
Пример #3
0
 protected void btnOk_Click(object sender, EventArgs e)
 {
     if (userModel != null)
     {
         if (txtTitle.Text.Trim() == "")
         {
             Function.ShowMsg(0, "<li>对不起,请输入问答标题</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
         }
         if (lsbCategory.SelectedValue == "")
         {
             Function.ShowMsg(0, "<li>对不起,请选择分类</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
         }
         M_Feedback model = new M_Feedback();
         int rewardNum = int.Parse(ddlReward.SelectedValue);
         if (userModel.Integral >= rewardNum)
         {
             model.Reward = rewardNum;
         }
         else
         { Function.ShowMsg(0, "<li>您的积分不够,不能设置为 "+rewardNum+" 的悬赏分</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>"); }
         model.ParentId = 0;
         model.ReplyDate = DateTime.Now;
         model.State = 0;
         model.Title = txtTitle.Text;
         model.Author = userModel.LogName;
         B_SiteInfo siteBll = new B_SiteInfo();
         model.Content = siteBll.GetFiltering(txtContent.Text);
         model.Ip = Request.UserHostAddress;
         model.EndDate = DateTime.Now.AddDays(14);
         model.CategoryId = int.Parse(lsbCategory.SelectedValue);
         feedback.Add(model);
         rewardNum = rewardNum * -1;
         moneyBll.Integral(rewardNum, userModel.LogName);
         Response.Redirect("MyFeedback.aspx");
     }
 }
Пример #4
0
 public void Add(M_Feedback model)
 {
     this.iF.Add(model);
 }