以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 代码问题!谢谢 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=4340) |
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 11:25:00 -- 代码问题!谢谢 Dim timeA As Date = e.Form.Controls("出生日期").Value Dim timeB As Date = e.Form.Controls("参加工作时间").Value Dim timeC As Date = e.Form.Controls("离休时间").Value Dim timeD As Date = e.Form.Controls("调整后执行起始时间").Value Dim timeE As Date = e.Form.Controls("上报日期").Value Dim timeF As Date = e.Form.Controls("主管部门审批日期").Value Dim timeG As Date = e.Form.Controls("审批部门审批日期").Value Dim timeH As Date =Date.Today() Dim timeI As Date = TimeH.AddDays(10) \'加上10天 Dim timeJ As TimeSpan = timeF - timeE Dim timeK As TimeSpan = timeG - timeF Dim timeL As Date = TimeH.AddDays(-10) \'减去10天 Dim timeM As Date = e.Form.Controls("标准起始时间").Value Dim timeN As Date = e.Form.Controls("最迟起始时间").Value Dim A,D,F,G,H,I,K,L,M,N,O,P,Q,R As String A = e.Form.Controls("单位名称").Value D = e.Form.Controls("姓名").Value F = e.Form.Controls("性别").Value G = e.Form.Controls("身份证号").Value H = e.Form.Controls("民族").Value I = e.Form.Controls("学历").Value K = e.Form.Controls("享受离休生活费等次").Value L = e.Form.Controls("补发月数").Value M = e.Form.Controls("标准起始年").Value N = e.Form.Controls("标准起始月").Value O = e.Form.Controls("最迟起始年").Value P = e.Form.Controls("最迟起始月").Value Q = e.Form.Controls("执行起始年").Value R = e.Form.Controls("执行起始月").Value if A = "" then MessageBox.Show("单位名称未录入,请录入单位名称!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if D = "" then MessageBox.Show("姓名未录入,请录入姓名!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if F = "" 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 timeA >= timeH then MessageBox.Show("出生日期不能等于或大于当前日期!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE If timeH.Year-timeA.Year > 110 then if MessageBox.Show("录入的此人年龄太大,是否正确!!!","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.No then Return \'终止代码的执行 ELSE If F="男" AND timeH.Year-timeA.Year < 60 then MessageBox.Show("年龄太小请检查是否正确!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE If F="女" AND timeH.Year-timeA.Year < 55 then MessageBox.Show("年龄太小请检查是否正确!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE if G = "" then MessageBox.Show("身份证号未录入,请录入身份证号!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If G.Length <> 15 AndAlso G.Length <>18 Then MessageBox.Show("身份证号位数错误!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else Dim drs As List(Of DataRow) drs = DataTables("GWYTB").Select("[身份证号] = \'" & e.Form.Controls("身份证号").Value & "\'") if drs.Count-1 >0 Then MessageBox.Show("身份证号码重复!!!") Return \'终止代码的执行 Else If F <> ReadSex(G) then MessageBox.Show("身份证号和性别不符!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else If timeA <> ReadBirthDay(G) MessageBox.Show("身份证号与出生日期不符!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if H = "" then MessageBox.Show("民族未录入,请录入民族!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if I = "" 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 timeB <= timeA 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 timeC < timeB then MessageBox.Show("离休时间不能小于参加工作时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE IF timeC >= timeH MessageBox.Show("离休时间不能等于或大于当前时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE IF timeB >= timeC MessageBox.Show("参加工作时间不能等于或大于离休时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE if K = "" 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 timeD < timeM then MessageBox.Show("执行起始时间小于了规定的起始时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE If timeD < timeC then MessageBox.Show("执行起始时间不能小于离休时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else IF timeD > timeN then MessageBox.Show("执行起始时间已超过了规定的截止时间!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE if L = "" then MessageBox.Show("补发月数未录入,请录入补发月数!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if L < 0 then MessageBox.Show("补发月数不能为负数!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 Else if L<>Nothing And L>((O-Q)*12+(P-R+1)) 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 timeE < timeL MessageBox.Show("上报日期小于当前日期过多!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE IF timeE > timeI 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 timeE > timeF 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 timeF > timeG MessageBox.Show("审批部门审批日期不能小于主管部门审批日期!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE If timeJ.Days > 10 then MessageBox.Show("主管部门审批时间与上报时间间隔过长!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return Else If timeK.Days > 10 then MessageBox.Show("审批部门审批时间与主管部门审批时间间隔过长!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return Else DataTables.Save() Syscmd.Row.Lock() End If END IF END IF End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if End if
|
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 11:33:00 -- If timeH.Year-timeA.Year > 110 then if MessageBox.Show("录入的此人年龄太大,是否正确!!!","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.No then Return \'终止代码的执行 ELSE If F="男" AND timeH.Year-timeA.Year < 60 then MessageBox.Show("年龄太小请检查是否正确!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE |
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 11:36:00 -- 这你想实现 1、大于110岁的人提示窗口出现,选择是,然后继续下面的 If F="男" AND timeH.Year-timeA.Year < 60 then MessageBox.Show("年龄太小请检查是否正确!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE 判断!!!2、小于110岁的人提示窗口不出现,直接继续下面的 If F="男" AND timeH.Year-timeA.Year < 60 then MessageBox.Show("年龄太小请检查是否正确!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Return \'终止代码的执行 ELSE 判断!!! |
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 11:37:00 -- If timeH.Year-timeA.Year > 110 then if MessageBox.Show("录入的此人年龄太大,是否正确!!!","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.No then Return \'终止代码的执行 ELSE 就是这不知道如何衔接!!!! |
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 14:01:00 -- 版主帮帮忙!!! |
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 14:41:00 --
|
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 14:55:00 --
|
||
-- 作者:雨中的泪 -- 发布时间:2009/9/15 15:15:00 --
|
||
-- 作者:mr725 -- 发布时间:2009/9/15 15:55:00 -- 参考帮助中的:TimeSpan Dim t As TimeSpan t = Date.Today - CDate(CurrentTable.Current("日期")) OutPut.Show("距今天数:" & t.TotalDays) |
||
-- 作者:blackzhu -- 发布时间:2009/9/15 15:55:00 -- 晕!不知道你做什么东西 |