using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class AddressAdd : System.Web.UI.Page
{
    JY.BLL.ReceiptAddress bll = new JY.BLL.ReceiptAddress();
    JY.Model.ReceiptAddress model = new JY.Model.ReceiptAddress();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) 
        {
            
        }
    }

    /// <summary>
    /// 收货地址添加
    /// </summary>
    public void tijiao_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["MemberID"] != null)
            {
                model.MemberId = Convert.ToInt32(Session["MemberID"]);
                model.Consignee = this.txtConsignee.Text.Trim();
                model.LiveAdderss = this.txtLiveAddress.Text.Trim();
                model.Phone = this.txtPhone.Text.Trim();
                model.ZipCode = this.txtZipCode.Text.Trim();
                model.CreateDate = Convert.ToDateTime(DateTime.Now.ToString());
                model.IsDelete = false;

                if (bll.Add(model) > 0)
                {
                    publicHandle.ShowMessage(this.Page, "恭喜您，添加收货地址成功！", "Address.aspx");
                }
                else
                {
                    publicHandle.ShowMessage(this.Page, "对不起，添加收货地址失败！", "AddressAdd.aspx");
                }
            }
        }
        catch (Exception er)
        {
            publicHandle.ShowMessage(this, er.Message);
        }
    }
}
