以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何取让变量值DateTimePicker中输入的时间? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=3910) |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 18:06:00 -- 如何取让变量值DateTimePicker中输入的时间? 如何取让变量值DateTimePicker中输入的时间? Dim d1 as Date d1= e.Form.Controls("出生时间"). IsDate Dim d2 as Date = e.Form.Controls("参加工作时间"). IsDate Dim A As String A = e.Form.Controls("单位名称").Value Dim B As String B = e.Form.Controls("姓名").Value Dim C As String C = e.Form.Controls("身份证号").Value Dim D As String D = e.Form.Controls("性别").Value Dim FF As String FF = e.Form.Controls("职务").Value if A = "" then MessageBox.Show("单位名称不能为空,请录入单位名称以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if B = "" then MessageBox.Show("人员姓名不能为空,请录入人员姓名以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if C = "" then MessageBox.Show("人员身份证号不能为空,请录入人员身份证号以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If e.Form.Controls("出生时间").Value Is Nothing then MessageBox.Show("人员出生时间不能为空,请录入人员出生时间以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if D = "" then MessageBox.Show("人员性别不能为空,请录入人员性别以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If e.Form.Controls("参加工作时间").Value Is Nothing then MessageBox.Show("人员参加工作时间不能为空,请录入人员参加工作时间以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if FF = "" then MessageBox.Show("人员现任职务不能为空,请录入人员现任职务以后再保存!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If D <> ReadSex(C) then MessageBox.Show("录入性别和身份证号不符,请核对!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If d2<=d1 then MessageBox.Show("参加工作时间不能大于出生时间,请核对!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE For Each dt As DataTable In DataTables dt.Save() Next Syscmd.Row.Lock() End If END IF END IF End if End if End if End if End if End if
|
|
-- 作者:杨浩 -- 发布时间:2009/8/18 18:07:00 -- 如何在按钮中实现: |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 18:08:00 -- 也就是身份证重复验证和身份证位数验证,在录入窗口的按钮中实现当前行的判断,并出现提示!!!谢谢 |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 18:09:00 -- If D <> ReadSex(C) then MessageBox.Show("录入性别和身份证号不符,请核对!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 性别我已经事项了,就是时间,头都大了!!! |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 18:15:00 -- 时间比较和身份证号比较!!!帮帮忙谢谢 |
|
-- 作者:mr725 -- 发布时间:2009/8/18 18:40:00 -- e.Form.Controls("出生时间"). IsDate 这个是什么??? 应该这样吧: e.Form.Controls("出生时间"). value (或 text) |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 20:42:00 -- e.Form.Controls("出生时间"). value (或 text) 取时间值提示错误!!!版主帮帮忙 如何让变量取时DateTimePicker中输入的时间?谢谢 |
|
-- 作者:mr725 -- 发布时间:2009/8/18 20:45:00 -- 以下是引用杨浩在2009-8-18 20:42:00的发言:
e.Form.Controls("出生时间"). value (或 text) 取时间值提示错误!!!版主帮帮忙 如何让变量取时DateTimePicker中输入的时间?谢谢 贴图!~~~ |
|
-- 作者:杨浩 -- 发布时间:2009/8/18 23:39:00 --
|
|
-- 作者:杨浩 -- 发布时间:2009/8/18 23:39:00 -- 按钮中如何实现上述代码?谢谢 |