多选项、多个选择项【c#】
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddDataInfoCertificate.ascx.cs" Inherits="DotNetNuke.Modules.Project.AddDataInfoCertificate" %>
<script type="text/javascript" src="http://www.beijingzc.com/js/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
table.BordTable {
border-collapse: collapse;
} table.BordTable td {
border: 2px solid #808080;
} } </style>
<asp:Panel ID="panMain" runat="server"> <asp:Button ID="btnCancel" runat="server" Text="←" OnClick="btnCancel_Click" Font-Bold="true" Font-Size="25px" />
<table>
<tr>
<td>
<asp:Label ID="lblBUseCertificateID" runat="server" Visible="false"></asp:Label>
</td>
</tr>
</table>
<table class="BordTable">
<tr>
<td>
<asp:Label ID="Label13" runat="server" Text="报备人:"></asp:Label>
</td>
<td>
<asp:Label ID="lblBidUserName" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Label19" runat="server" Text="报备日期:"></asp:Label>
</td>
<td>
<asp:Label ID="lblBidDate" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4" style="text-align: center">
<asp:Label ID="Label14" runat="server" Text="title" Font-Bold="true"></asp:Label>
</td>
</tr> <tr>
<td>
<asp:Label ID="Label17" runat="server" Text="证书类型:"></asp:Label>
</td>
<td colspan="3">
<asp:CheckBox ID="CheckBox1" runat="server" Text="注册造价师" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="一级建造师" />
<asp:CheckBox ID="CheckBox3" runat="server" Text="招标师" />
<asp:CheckBox ID="CheckBox4" runat="server" Text="咨询师" />
<asp:CheckBox ID="CheckBox5" runat="server" Text="监理师" />
<asp:CheckBox ID="CheckBox6" runat="server" Text="公路造价师" />
<asp:CheckBox ID="CheckBox7" runat="server" Text="造价员" />
<asp:DropDownList ID="ddlCName" runat="server" Width="220px">
<asp:ListItem Text="请选择:" Value="请选择:" Selected="True"></asp:ListItem>
<asp:ListItem Text="注册造价师" Value="注册造价师"></asp:ListItem>
<asp:ListItem Text="一级建造师" Value="一级建造师"></asp:ListItem>
<asp:ListItem Text="招标师" Value="招标师"></asp:ListItem>
<asp:ListItem Text="咨询师" Value="咨询师"></asp:ListItem>
<asp:ListItem Text="监理师" Value="监理师"></asp:ListItem>
<asp:ListItem Text="公路造价师" Value="公路造价师"></asp:ListItem>
<asp:ListItem Text="造价员" Value="造价员"></asp:ListItem>
</asp:DropDownList>
</td>
</tr> <tr>
<td>
<asp:Label ID="Label1" runat="server" Text="备注:"></asp:Label>
</td>
<td colspan="3">
<asp:TextBox ID="tbxRemarks" runat="server" Width="320px" Height="50px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4">
<asp:Label ID="lblMessage" runat="server" ForeColor="Red" ToolTip="Day1"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4" align="center">
<asp:Button ID="btnSubmit" runat="server" Text="提交" OnClick="btnSubmit_Click" /> </td>
</tr> </table> </asp:Panel>
-------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
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 DotNetNuke;
using DotNetNuke.Security.Roles;
using DotNetNuke.Services.Localization;
using DotNetNuke.Security;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Modules.HRAddUser; namespace DotNetNuke.Modules.Project
{
public partial class AddDataInfoCertificate : DotNetNuke.Entities.Modules.PortalModuleBase, DotNetNuke.Entities.Modules.IActionable
{ private DotNetNuke.Modules.HRAddUser.HRAddUserController hrc = new HRAddUserController();
private DotNetNuke.Modules.Project.ProjectController pc = new ProjectController(); protected void Page_Load(object sender, EventArgs e)
{ if (!IsPostBack)
{
FillUI();
}
}
private void FillUI()
{
ddlCName.Visible = false; if (Convert.ToInt32(lblBUseCertificateID.Text) > 0)
{
CheckBox1.Visible = false;
CheckBox2.Visible = false;
CheckBox3.Visible = false;
CheckBox4.Visible = false;
CheckBox5.Visible = false;
CheckBox6.Visible = false;
CheckBox7.Visible = false;
string sWhere = " where BUseCertificateID=" + Convert.ToInt32(lblBUseCertificateID.Text) + " ";
DataTable dtBidProject = pc.GetDataInfoCertificate(sWhere);
lblBidUserName.Text = Convert.ToString(dtBidProject.Rows[0]["SubmitUserName"]);
lblBidDate.Text = Convert.ToDateTime(dtBidProject.Rows[0]["CreateDate"]).ToString("yyyy-MM-dd");
tbBeUsedName.Text = Convert.ToString(dtBidProject.Rows[0]["BeUsedName"]);
ddlCName.Visible = true;
ddlCName.SelectedValue = Convert.ToString(dtBidProject.Rows[0]["CName"]);
}
else
{
lblBidUserName.Text = UserInfo.DisplayName;
lblBidDate.Text = DateTime.Today.ToString("yyyy-MM-dd");
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (CheckInput())
{ if (Convert.ToInt32(lblBUseCertificateID.Text) > 0)
{
pc.UpdateDataInfoCertificateInfo(Convert.ToInt32(lblBUseCertificateID.Text), baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, ddlCName.SelectedValue, tbxRemarks.Text, UserId);
}
else
{
if (CheckBox1.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "注册造价师", tbxRemarks.Text, UserId);
}
if (CheckBox2.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "一级建造师", tbxRemarks.Text, UserId);
}
if (CheckBox3.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "招标师", tbxRemarks.Text, UserId);
}
if (CheckBox4.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "咨询师", tbxRemarks.Text, UserId);
}
if (CheckBox5.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "监理师", tbxRemarks.Text, UserId);
}
if (CheckBox6.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "公路造价师", tbxRemarks.Text, UserId);
}
if (CheckBox7.Checked == true)
{
pc.AddDataInfoCertificateInfo(baid, beuserdid, tbBeUsedName.Text,
ddlTitle.SelectedValue, "造价员", tbxRemarks.Text, UserId);
} }
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
}
} protected void btnCancel_Click(object sender, EventArgs e)
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
} private bool CheckInput()
{
bool Result = true; if (ddlBidProjectName.Text == "请选择")
{
lblMessage.Text = "请选择投标项目名称。";
Result = false;
} return Result;
} #region IActionable 成员 DotNetNuke.Entities.Modules.Actions.ModuleActionCollection DotNetNuke.Entities.Modules.IActionable.ModuleActions
{
get
{
Entities.Modules.Actions.ModuleActionCollection Actions = new
Entities.Modules.Actions.ModuleActionCollection();
Actions.Add(GetNextActionID(),
Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent,
LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "",
EditUrl(), false, SecurityAccessLevel.Edit, true, false);
return Actions;
}
} #endregion }
}
多选项、多个选择项【c#】的更多相关文章
- Js获取下拉框当前选择项的文本和值
现在有一个Id为AreaId的下拉框,要获取它当前选择项的文本和值有以下方法: <span class="red">* </span> 地 区: ...
- Chosen中选择项的更新
Chosen 选择项的动态修改/更新 如果你需要去动态更新select选择框里的选择项,你需要通知Chosen去响应这个变动,你需要在这个选项框是触发一个"liszt:updated&quo ...
- selenium 定位input输入框下的选择项
今天的问题与下图中的类似 这是一个input型输入框,当我点击或输入值时,输入框下方会显示选择项帮助快速输入,代码如下: <input class="v-input some" ...
- iOS开发——UI篇&下拉弹出列表选择项效果
下拉弹出列表选择项效果 右边菜单中的按键,点击弹出一个列表可选择,选择其中一个,响应相应的事件并把文字显示在右边的菜单上:弹出下拉效果使用LMDropdownView插件,可以用POD进行加载pod ...
- C# winform 选择项 省市连动
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- CentOS6.9-zabbix3.2启动失败原因及页面没有mysql选择项
环境内核信息: [root@zabbix- ~]# uname -a Linux lodboyedu- -.el6.x86_64 # SMP Tue Mar :: UTC x86_64 x86_64 ...
- WPF中使用后台代码来控制TreeView的选择项(SelectedItem)以及展开节点操作
首先为TreeView控件制作一个Style: <Style x:Key="LibraryTreeViewItemStyle" TargetType="{x:Typ ...
- springMVC 复选框带有选择项记忆功能的处理
前言:由于jsp管理页面经常会遇到复选框提交到JAVA后台,后台处理逻辑完成后又返回到jsp页面,此时需要记住jsp页面提交时复选框的选择状态,故编写此功能! 一.复选框的初始化 1.1.jsp页面 ...
- 使ListView控件中的选择项高亮显示
实现效果: 知识运用: ListView控件的SelectedItems属性 //获取在ListView控件中被选中数据项的集合 public ListView.SelectedListViewIte ...
- wpf ListBox删除选择项(支持多项)
搞了个ListBox删除选择项,开始老是不能把选择项删除干净,剩下几个.后来调试一下原来是ListBox在删除一个选择项之后立即更新,选择项也有变化.结果我想了个这样的方法来删除呵呵. Departm ...
随机推荐
- Envoy实现.NET架构的网关(二)基于控制平面的动态配置
什么是控制平面 上一篇我们讲了文件系统的动态配置,这次我们来看看通过Control Panel来配置Envoy.控制平面就是一个提供Envoy配置信息的单独服务,我们可以通过这个服务来修改Envoy的 ...
- python re:正则表达式中使用变量
参考:https://www.cnblogs.com/songbiao/p/12422632.html Python中正则表达式的写法,核心就是一个字符串.如下:re.compile(r'表达式')所 ...
- linux hostid与lmhostid
https://wangchujiang.com/linux-command/c/hostid.html hostid(host identifier) 显示当前主机的十六进制数字标识. 概要 hos ...
- JAVA笔记12__字节、字符缓冲流/打印流/对象流/
/** * !!:以后写流的时候一定要加入缓冲!! * 对文件或其它目标频繁的读写操作,效率低,性能差. * 缓冲流:好处是能更高效地读写信息,原理是将数据先缓冲起来,然后一起写入或读取出来. * * ...
- poj 2724 Purifying Machine(二分图最大匹配)
题意: 有2^N块奶酪,编号为00...0到11..1. 有一台机器,有N个开关.每个开关可以置0或置1,或者置*.但是规定N个开关中最多只能有一个开关置*. 一旦打开机器的开关,机器将根据N个开关的 ...
- poj 1129 Channel Allocation(图着色,DFS)
题意: N个中继站,相邻的中继站频道不得相同,问最少需要几个频道. 输入输出: Sample Input 2 A: B: 4 A:BC B:ACD C:ABD D:BC 4 A:BCD B:ACD C ...
- 王爽汇编第五章,[bx]和loop指令
目录 王爽汇编第五章,[bx]和loop指令 [bx]和loop指令 例子: 王爽汇编第五章,[bx]和loop指令 [bx]和loop指令 [bx]之前我们介绍寄存器的时候,已经很详细的说明过了,b ...
- OAuth 2.0 的探险之旅
前言 OAuth 2.0 全称是 Open Authorization 2.0, 是用于授权(authorization)的行业标准协议. OAuth 2.0 专注于客户端开发人员的简单性,同时为 W ...
- openstack 后期维护(四)--- 删除僵尸卷
前言: 在长时间使用openstack之后,删除虚机后,经常会有因这样那样的问题,导致卷处于僵尸状态,无法删除! 状态一: 虚机已近删除,然而卷却挂在到了 None上无法删除 解决办法: 1.# ci ...
- SpringBoot2.x请求注解简单介绍(4)
1.新建项目,项目中实战讲解注解作用 2.pom.xml依赖配置 <properties> <project.build.sourceEncoding>UTF-8</pr ...