private string CheckInfo() { bool isEdit = false; if (Request.Form["state"] == "edit") { isEdit = true; } DataSet ds = UserInfoManage.CheckInfo(Request.Form["code"], GetUserInfo().companyId.ToString(), Request.Form["mobile"], Request.Form["idNumber"]); int standartNumber = 0;//插入模式不允许查询到记录 if (isEdit) { standartNumber = 1;//编辑模式最多查询到1条记录 } string res = "数据库读取失败!"; if (ds != null) { string res1 = ""; if (ds.Tables[0].Rows.Count > standartNumber) { res1 += "手机号、"; } if (ds.Tables[1].Rows.Count > standartNumber) { res1 += "工号、"; } if (ds.Tables[2].Rows.Count > standartNumber) { res1 += "身份证号、"; } if (string.IsNullOrEmpty(res1)) { res = "T"; } else { res1 = res1.Substring(0, res1.Length - 1);//删掉最后一个顿号 res1 += "已存在,请重新输入!"; res = res1; } } return(res); }