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 manage_voteadd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql0 = "insert into vtitle(vtname) values('" + TextBox1.Text + "')";
        oper.opertb(sql0);
        string sql2 = "select top 1 vtid from vtitle order by vtid desc";
        Int32 vtid = Convert.ToInt32(oper.findstr(sql2));
        string sql1 = "insert into vdetail(vdname,vtid) values('" + TextBox2.Text + "'," + vtid + ")";
        oper.opertb(sql1);
        sql1 = "insert into vdetail(vdname,vtid) values('" + TextBox3.Text + "'," + vtid + ")";
        oper.opertb(sql1);
        sql1 = "insert into vdetail(vdname,vtid) values('" + TextBox4.Text + "'," + vtid + ")";
        oper.opertb(sql1);
        sql1 = "insert into vdetail(vdname,vtid) values('" + TextBox5.Text + "'," + vtid + ")";
        oper.opertb(sql1);
        Response.Write("添加投票成功！");
    }
}
