using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Email.Subscription;

public partial class Member_Subscription_SubscriptionProductAdd : nspBase.MemberBasePge
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (CheckCookies())
        {
    
        }
        else
            Response.Redirect("../../login/login.aspx");
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            SubscriptionProduct product = new SubscriptionProduct();
            product.UserID = int.Parse(GetCookie("UserID"));
            string myValue = "";
            myValue += Request.Form["ctl00$ContInfo$SortB"];
            myValue += ',' + Request.Form["ctl00$ContInfo$SortM"];
            myValue += ',' + Request.Form["ctl00$ContInfo$SortS"];
            product.Indtype = myValue;
            myValue = "";
          //  product.Type = chklProduct.SelectedValue;
            product.Keyword = txtKeyword.Text.Trim();
            myValue += Request.Form["ctl00$ContInfo$province"] + ',';
            myValue += Request.Form["ctl00$ContInfo$city"] + ',';
            myValue += Request.Form["ctl00$ContInfo$county"];
            product.Area = myValue;
            product.Validity = int.Parse(dropValidity.SelectedValue);
            for (int i = 0; i < this.chklProduct.Items.Count; i++)
            {
                if (this.chklProduct.Items[i].Selected == true)
                {
                    product.Type = this.chklProduct.Items[i].Text;
                    product.Insert(product);
                }
            }
            ShowMessage("商机订阅成功！", "Subscription/SubscriptionProductList.aspx");
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message);
        }
    }
}
