using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using JY.Model;
using JY.BLL;
using Maticsoft.DBUtility;
using System.Text;

public partial class Review_Add : PasePage
{
    JY.BLL.Review bll = new JY.BLL.Review();
    JY.Model.Review model = new JY.Model.Review();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
        }
    }

    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void tijiao_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            model.ProductId = Convert.ToInt32(txtProductId.Text.Trim());
            model.ReviewContent = txtReviewContent.Value;
            model.ReplyContent = txtReplyContent.Value;
            model.ReviewName = txtReviewName.Text.Trim();
            model.ReviewDate = DateTime.Now;
            model.IsDelete = false;
            if (bll.Add(model) > 0)
            {
                publicHandle.ShowMessage(this.Page, "恭喜您，评论添加成功！", "Review_Manage.aspx");
            }
            else
            {
                publicHandle.ShowMessage(this.Page, "对不起，评论添加失败！", "Review_Manage.aspx");
            }
        }
        catch (Exception er)
        {
            publicHandle.ShowMessage(this, er.Message);
        }
    }

    /// <summary>
    /// 取消事件
    /// </summary>
    public void btnReturn_Click(object sender, EventArgs e)
    {
        Response.Redirect("Review_Manage.aspx");
    }
}

