Beispiel #1
0
        public void Add(AlmsDonationViewModel viewModel)
        {
            _repository.Add(new AlmsDonation
            {
                CreationDate = DateTime.Now,
                IsItDeleted  = false,
                Status       = true,

                Name           = viewModel.Name,
                Surname        = viewModel.Surname,
                Email          = viewModel.Email,
                City           = viewModel.City,
                Adress         = viewModel.Adress,
                PhoneNumber    = viewModel.PhoneNumber,
                ZipCode        = viewModel.ZipCode,
                AdditionalInfo = viewModel.AdditionalInfo,
                AlmsAmount     = viewModel.AlmsAmount
            });
        }
Beispiel #2
0
        public void Update(AlmsDonationViewModel viewModel) // Gerek yok aslında
        {
            var almsdonations = _repository.Get(x => x.Id == viewModel.Id);

            almsdonations.Status       = viewModel.Status;
            almsdonations.DateOfUpdate = DateTime.Now;
            almsdonations.IsItDeleted  = viewModel.IsItDeleted;


            almsdonations.Name           = viewModel.Name;
            almsdonations.Surname        = viewModel.Surname;
            almsdonations.Email          = viewModel.Email;
            almsdonations.City           = viewModel.City;
            almsdonations.Adress         = viewModel.Adress;
            almsdonations.PhoneNumber    = viewModel.PhoneNumber;
            almsdonations.ZipCode        = viewModel.ZipCode;
            almsdonations.AdditionalInfo = viewModel.AdditionalInfo;
            almsdonations.AlmsAmount     = viewModel.AlmsAmount;

            _repository.Update(almsdonations);
        }