| | |
| | | |
| | | 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<MesSupplier>().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 |
| | |
| | | Fstaffid = supplier.FStaffId, |
| | | Fforbidstatus = supplier.FForbidStatus, |
| | | CreateDate = DateTime.Now, |
| | | CreateOrg= Convert.ToDecimal(supplier.FCreateOrgId), |
| | | UseOrg= Convert.ToDecimal(supplier.FUseOrgId), |
| | | Remark=supplier.FDescription, |
| | | CreateOrg = Convert.ToDecimal(supplier.FCreateOrgId), |
| | | UseOrg = Convert.ToDecimal(supplier.FUseOrgId), |
| | | Remark = supplier.FDescription, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |