Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        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();
        }