public void DeleteLeaseGuarantee(LeaseGuaranteeDTO guarantee) { if (guarantee == null) { throw new Exception("保证金不能为空"); } Guarantee persistGuarantee = _guaranteeRepository.Get(guarantee.GuaranteeId); if (persistGuarantee == null) { throw new Exception("找不到需要删除的保证金"); } DeleteGuarantee(persistGuarantee); }
public void ModifyLeaseGuarantee(LeaseGuaranteeDTO guarantee) { if (guarantee == null) { throw new Exception("保证金不能为空"); } var persistGuarantee = _guaranteeRepository.Get(guarantee.GuaranteeId) as LeaseGuarantee; if (persistGuarantee == null) { throw new Exception("找不到需要更新的保证金"); } if (!(persistGuarantee.StartDate == guarantee.StartDate)) { persistGuarantee.StartDate = guarantee.StartDate; } if (!(persistGuarantee.EndDate == guarantee.EndDate)) { persistGuarantee.EndDate = guarantee.EndDate; } if (!(persistGuarantee.SupplierId.Equals(guarantee.SupplierId))) { persistGuarantee.SetSupplier(guarantee.SupplierId, guarantee.SupplierName); } if (!(persistGuarantee.Amount.Equals(guarantee.Amount))) { persistGuarantee.Amount = guarantee.Amount; } if (persistGuarantee.Reviewer != (guarantee.Reviewer)) { persistGuarantee.Review(guarantee.Reviewer); } if (persistGuarantee.CurrencyId != guarantee.CurrencyId) { persistGuarantee.SetCurrency(guarantee.CurrencyId); } if (persistGuarantee.OrderId != guarantee.OrderId) { persistGuarantee.SetOrderId(guarantee.OrderId); } if (persistGuarantee.OperatorName != guarantee.OperatorName) { persistGuarantee.SetOperator(guarantee.OperatorName); } if (persistGuarantee.Status != (GuaranteeStatus) guarantee.Status) { persistGuarantee.SetGuaranteeStatus((GuaranteeStatus) guarantee.Status); } UpdateGuarantee(persistGuarantee); }
public void InsertLeaseGuarantee(LeaseGuaranteeDTO guarantee) { if (guarantee == null) { throw new Exception("保证金不能为空"); } LeaseGuarantee newGuarantee = GuaranteeFactory.CreateLeaseGuarantee(guarantee.StartDate, guarantee.EndDate, guarantee.Amount, guarantee.SupplierName, guarantee.OperatorName, guarantee.SupplierId, guarantee.CurrencyId, guarantee.OrderId, guarantee.Status, guarantee.Reviewer); AddGuarantee(newGuarantee); }