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 Collection_Add : PasePage
{
    JY.BLL.Collection bll = new JY.BLL.Collection();
    JY.Model.Collection model = new JY.Model.Collection();
    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.MemberId = Convert.ToInt32(txtMemberId.Text.Trim());
            model.CollectionDate = DateTime.Now;
            model.IsDelete = false;
            
            if (bll.Add(model) > 0)
            {
                publicHandle.ShowMessage(this.Page, "恭喜您，收藏添加成功！", "Collection_Manage.aspx");
            }
            else
            {
                publicHandle.ShowMessage(this.Page, "对不起，收藏添加失败！", "Collection_Manage.aspx");
            }
        }
        catch (Exception er)
        {
            publicHandle.ShowMessage(this, er.Message);
        }
    }
}

