啊鑫
2024-10-22 e08a2e8a24be0996dec3b681f3c4ab45333f331c
MES.Service/service/BasicData/MesSupplierManager.cs
@@ -1,5 +1,4 @@
using Castle.Core.Resource;
using MES.Service.DB;
using MES.Service.DB;
using MES.Service.Dto.webApi;
using MES.Service.Modes;
using SqlSugar;
@@ -128,8 +127,8 @@
            Telf1 = supplier.FTel,
            Fstaffid = supplier.FStaffId,
            Fforbidstatus = supplier.FForbidStatus,
            type = supplier.Type,
            Remarks = supplier.FDescription,
            Type = supplier.Type,
            Remark = supplier.FDescription,
            FSubsidiary = supplier.FUseOrgId,
            Fumbrella = supplier.FCreateOrgId,
            CreateDate = DateTime.Now,
@@ -176,19 +175,12 @@
    private bool InsertOrUpdate(SqlSugarScope db, MesSupplier entity)
    {
        var exists = db.Queryable<MesSupplier>().Any(e => e.Id == entity.Id);
        if (exists)
        {
            var update = db.Updateable(entity).ExecuteCommand();
            if (update > 0)
                return true;
        }
        else
        {
            var insert = db.Insertable(entity).ExecuteCommand();
            if (insert > 0)
                return true;
        }
        db.Deleteable<MesSupplier>().Where(s => s.Id == entity.Id)
            .ExecuteCommand();
        var insert = db.Insertable(entity).ExecuteCommand();
        if (insert > 0)
            return true;
        return false;
    }