| | |
| | | |
| | | private bool InsertSupplier(SqlSugarScope db, MesSupplier entity) |
| | | { |
| | | var exists = db.Queryable<MesSupplier>().Any(e => e.Id == entity.Id); |
| | | var exists = db.Queryable<MesSupplier>().Any(e => e.Id == entity.Id && e.SuppNo == entity.SuppNo); |
| | | if (exists) |
| | | { |
| | | var result = db.Updateable(entity).ExecuteCommand(); |
| | | var result = db.Updateable(entity).Where(e => e.Id == entity.Id && e.SuppNo == entity.SuppNo).ExecuteCommand(); |
| | | return true; |
| | | } |
| | | else |
| | |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesSupplier entity) |
| | | { |
| | | var exists = db.Queryable<MesSupplier>().Any(e => e.Id == entity.Id); |
| | | var exists = db.Queryable<MesSupplier>().Any(e => e.Id == entity.Id && e.SuppNo == entity.SuppNo); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | var update = db.Updateable(entity).Where(e => e.Id == entity.Id && e.SuppNo == entity.SuppNo).ExecuteCommand(); |
| | | return true; |
| | | } |
| | | else |