请帮助我确定输入的薪水是否在定义的范围内 [英] Plz help me to find whether the entered salary is between defined range

查看:57
本文介绍了请帮助我确定输入的薪水是否在定义的范围内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Table(BasicSalaryDefine),其中定义了2个字段,即FromAmount和ToAmount ...

在另一个表(CorporateTitle)中有薪金字段...

我要检查输入的薪水(在CorporateTitle中)是否在Range之间

如果在范围内,则保存,否则不保存



请帮助我

I hav Table(BasicSalaryDefine) where 2 fields i.e FromAmount And ToAmount is defined...

and in another table(CorporateTitle) there is Salary field...

Ihav to chek the entered salary(in CorporateTitle) is between the RAnge or not

if it is in range then save otherwise not to save



plz guyz help me

推荐答案

首先在某些变量中获得TextBox值(例如sal).
从数据库表中检索值(例如minSal和maxSal).
然后检查输入的薪水是否在两个检索到的值之间:
First get your TextBox value in some variable (say sal).
Retrieve values (say minSal & maxSal) from your DataBase Table.
Then check whether entered salary is between the two retrieved values:
if(sal<=maxSal && sal>=minSal)
{
  //save sal in DataBase
}
else
{
  //Generate an error
}


这样就完成了!


And you''re done!


这篇关于请帮助我确定输入的薪水是否在定义的范围内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆