如题,想在if中再添加一个if语句,如果workerNo存在,无法提交;不存在,则添加成功
if (workerName != string.Empty && workerSex != string.Empty && workerNo != string.Empty && workerGroup != string.Empty && workerType != string.Empty && workerStatus != string.Empty)
{
string insertform = "INSERT INTO hr_workerinfo(workerName,workerSex,workerNo,workerGroup,workerType,createTime,updateTime,workerStatus)" +
"values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')";
string insertsql = String.Format(insertform, workerName, workerSex, workerNo, workerGroup, workerType, createTime, updateTime, workerStatus);
commonEntity.mysqlComExecute(insertsql);
MessageBox.Show("添加成功!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("提交信息不完整!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}