1个回答
展开全部
List<Table> tablelist = new List<Table>();
bool isChongfu = false;
public void Save(Table table)
{
foreach (Table table1 in tablelist)
{
if (table.Uid.Equals(table1.Uid))
{
isChongfu = true;
}
}
if (isChongfu == false)
{
tablelist.Add(table);
}
else
{
MessageBox.Show("uid重复");
isChongfu = false;
}
}
bool isChongfu = false;
public void Save(Table table)
{
foreach (Table table1 in tablelist)
{
if (table.Uid.Equals(table1.Uid))
{
isChongfu = true;
}
}
if (isChongfu == false)
{
tablelist.Add(table);
}
else
{
MessageBox.Show("uid重复");
isChongfu = false;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询