南骏 池
5 天以前 3a6f7cb36dff0ec99edddbb53078947fcf08a47e
MES.Service/service/BasicData/MesSupplierManager.cs
@@ -23,14 +23,11 @@
                    if (UpdateSupplierStatus(db, entity.Id, "B"))
                        return 1;
                    break;
                case "2":
                    if (InsertSupplier(db, entity))
                        return 1;
                    break;
                case "3":
                    if (DeleteSupplier(entity.Id))
                        return 1;
                    break;
                case "2":
                case "4":
                    if (InsertOrUpdate(db, entity))
                        return 1;
@@ -65,14 +62,11 @@
                                "B"))
                            throw new NotImplementedException("禁用失败");
                        break;
                    case "2":
                        if (!InsertSupplierBatch(db, supplierGroup.Value))
                            throw new NotImplementedException("插入失败");
                        break;
                    case "3":
                        if (!DeleteSupplierBatch(db, supplierGroup.Value))
                            throw new NotImplementedException("删除失败");
                        break;
                    case "2":
                    case "4":
                        if (!InsertOrUpdateBatch(db, supplierGroup.Value))
                            throw new NotImplementedException("同步失败");
@@ -110,7 +104,10 @@
    private bool DeleteSupplier(decimal supplierId)
    {
        if (base.DeleteById(supplierId)) return true;
        var deleteById = Db.Deleteable<MesSupplier>()
            .Where(s => s.Id == supplierId).ExecuteCommand();
        if (deleteById > 0)
            return true;
        throw new NotImplementedException("删除失败");
    }