Пример #1
0
        public void UpdateFemale(FemaleParrentsMale female)
        {
            var femaleEntity = new Help.TypesConverter.ToFemales().Convert(female);
            var parrents = new Help.TypesConverter.ToParrents().Convert(female);
            parrents.Id = new ParrentsManager().GetParrents(female.Id).Id;

            using (var transaction = new TransactionScope())
            {
                new FemalesRepository().UpdateFemale(femaleEntity);
                new ParrentsRepository().UpdateParrents(parrents);

                transaction.Complete();
            }
        }
Пример #2
0
        public void AddFemale(FemaleParrentsMale female)
        {
            var femaleEntity = new Help.TypesConverter.ToFemales().Convert(female);
            var parrents = new Help.TypesConverter.ToParrents().Convert(female);

            using (var transaction = new TransactionScope())
            {
                new FemalesRepository().AddFemale(femaleEntity);
                parrents.FemaleId = new FemalesRepository().GetFemale(femaleEntity.Name).Id;
                new ParrentsRepository().AddParrents(parrents);

                transaction.Complete();
            }
        }