checkbox和table

前台:

<div id="ISO" 
        style="position:absolute; top:110px; left:330px; height:309; width:309px; padding:10px 20px 0; display:none; background:lightblue;text-align:left; border:2px solid #5d3f0c;z-index:999; font-size:12px; height: 221px;">
    <table style="width: 103%; height: 209px;" border="1" cellpadding="1" cellspacing="1">
    <tr>
    <td colspan="4" style="font-size: large; font-weight: 700; font-family: 隶书" align="center">
    ISO认证投资
    </td>
    </tr>
    <tr>
    <th width="20%" align="center">操作项
    </th>
    <th width="17%"  align="center">ISO名称
    </th>
    <th width="30%"  align="center">投资总时间
    </th>
    <th width="33%"  align="center">剩余投资时间
    </th>
    </tr>
    <tr align="center">
    <td>
        <asp:CheckBox ID="checkbox9000" runat="server" />
    </td>
    <td>
        <asp:Label ID="iso9000" runat="server" Text="ISO9000"></asp:Label>
    </td>
    <td>2年
    </td>
    <td >
        <asp:Label ID="last9000" runat="server" Text=""></asp:Label>
    </td>
    </tr>
    <tr align="center">
    <td>
        <asp:CheckBox ID="checkbox14000" runat="server" />
    </td>
    <td>
        <asp:Label ID="iso14000" runat="server" Text="ISO14000"></asp:Label>
    </td>
    <td>2年
    </td>
    <td>
        <asp:Label ID="last14000" runat="server" Text=""></asp:Label>
    </td>
    </tr>
    <tr>
    <td colspan="4" align="center">
            <asp:Button ID="sureiso" runat="server" Text="确认投资" Height="20px"
            Width="72px" onclick="sureiso_Click"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                    
            <asp:Button ID="quxiaoiso" runat="server" Text="取消" Height="20px"
            Width="72px" onclick="quxiaoiso_Click"/>
        </td>
    </tr>
    </table>
    </div>

 

 

后台cs:

 protected void sureiso_Click(object sender, EventArgs e)
    {
        string tdid = Request.Cookies["tdid"].Value;
        int n = 0;
        Model.iso iso = new Model.iso();
        BLL.iso blliso = new BLL.iso();
        if (checkbox9000.Checked)
        {
            iso.stuid = 1;
            iso.isoname = iso9000.Text.ToString();
            iso.needseason = 2;
            iso.lastseason = 1;
            int result = blliso.set(iso);
            n += result;
        }
        if (checkbox14000.Checked)
        {
            iso.stuid = 1;
            iso.isoname = iso14000.Text.ToString();
            iso.needseason = 2;
            iso.lastseason = 1;
            int result = blliso.set(iso);
            n += result;
        }
        if (n == 0)
            Response.Write("<script language = javascript>alert('ISO认证投资成功!')</script>");
        else
            Response.Write("<script language = javascript>alert('对不起,ISO认证投资失败!')</script>");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "tanchu(" + tdid + ")", true);
    }

posted @ 2010-05-06 08:21  j2ee技术  阅读(160)  评论(0编辑  收藏  举报