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;

public partial class UserControl_activeInfo : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "update")
        {
            string id = this.DataList1.DataKeys[e.Item.ItemIndex].ToString();
            MODEL.Employee emp = BLL.BLLemployee.getMobile(Session["user"].ToString());
            if (BLL.BLLactiveInfo.checkActive(Convert.ToInt32(id),emp.EmployeeID) == false)
            {
                msgBox.putMsg("你已经投过票了");
                return;
            }
           
            AccessDataSource1.UpdateParameters[0].DefaultValue = id;
            AccessDataSource1.Update();

            //跟新附表。。。
            
            BLL.BLLactiveInfo.Insert(Convert.ToInt32(id), emp.EmployeeID);

        }
    }

}
