111,128
社区成员
发帖
与我相关
我的任务
分享
if (!CustomerDataBll.isEmailExist(Model.cCustomerEmail, Model.cUserName))
{
tsProgressBar.Visible = true;
tsProgressBar.PerformStep();
if (CustomerDataBll.addToDataBase(Model))//添加到数据库
{
tsslStatus.Text = "状态:入库" + Model.cCustomerEmail + "...";
i++;
}
else
{
tsslStatus.Text = "状态:入库失败" + Model.cCustomerEmail + "...";
}
}
else
{
//this.tsProgressBar.Visible = false;
tsslStatus.Text = "状态:过滤" + Model.cCustomerEmail;
}
/////以下是数据库层判断
public bool isEmailExist(string CustomerEmail, string userName)
{
OleDbParameter[] parameters = {
new OleDbParameter("@CustomerEmail", CustomerEmail),
new OleDbParameter("@userName", userName),
};
return DBhelper.Exists("select email from CustomerData where email=@CustomerEmail and userName=@userName", parameters);
}
