private void UpdateRepairCard(RepairCard repairCard, Automobile automobile, DateTime?finishRepairDate, string description, decimal sparePartsPrice, decimal repairPrice, ListItemCollection sparePartItems) { repairCard.Automobile = automobile; repairCard.Description = (string.IsNullOrEmpty(description) ? null : description); repairCard.FinishRepair = finishRepairDate; repairCard.PartPrice = sparePartsPrice; repairCard.CardPrice = repairPrice; CarServicePresentationUtility.AddSpareParts(repairCard, sparePartItems, this.persister); this.persister.SaveChanges(); }
private void SaveRepairCard(Automobile automobile, DateTime startRepairDate, string description, decimal sparePartsPrice, decimal repairPrice, ListItemCollection sparePartItems) { MembershipUser currentUser = Membership.GetUser(); RepairCard newRepairCard = new RepairCard() { Automobile = automobile, UserId = ((System.Guid)currentUser.ProviderUserKey), StartRepair = startRepairDate, Description = (string.IsNullOrEmpty(description) ? null : description), PartPrice = sparePartsPrice, CardPrice = repairPrice }; CarServicePresentationUtility.AddSpareParts(newRepairCard, sparePartItems, this.persister); this.persister.CreateRepairCard(newRepairCard); this.persister.SaveChanges(); }