public PendingQuoteItem CreatePending( Guid id, Guid customerId, Guid jobItemId, decimal labour, decimal calibration, decimal parts, decimal carriage, decimal investigation, string report, int days, bool beyondEconomicRepair, string orderNo, string adviceNo) { if (!CurrentUser.HasRole(UserRole.Member)) { throw new DomainValidationException(Messages.InsufficientSecurity, "CurrentUser"); } if (id == Guid.Empty) { throw new ArgumentException("An ID must be supplied for the pending item"); } if (_quoteItemRepository.JobItemHasPendingQuoteItem(jobItemId)) { throw new DomainValidationException(Messages.PendingItemExists, "JobItemId"); } var pendingItem = new PendingQuoteItem(); pendingItem.Id = id; pendingItem.OrderNo = orderNo; pendingItem.AdviceNo = adviceNo; pendingItem.Customer = GetCustomer(customerId); pendingItem.JobItem = GetJobItem(jobItemId); pendingItem.Labour = GetLabour(labour); pendingItem.Calibration = GetCalibration(calibration); pendingItem.Parts = GetParts(parts); pendingItem.Carriage = GetCarriage(carriage); pendingItem.Investigation = GetInvestigation(investigation); pendingItem.Report = report; pendingItem.Days = GetDays(days); pendingItem.BeyondEconomicRepair = beyondEconomicRepair; ValidateAnnotatedObjectThrowOnFailure(pendingItem); _quoteItemRepository.CreatePendingQuoteItem(pendingItem); return(pendingItem); }
public void UpdatePendingItem(PendingQuoteItem pendingItem) { CurrentSession.Update(pendingItem); }
public void CreatePendingQuoteItem(PendingQuoteItem pendingQuoteItem) { CurrentSession.Save(pendingQuoteItem); }