Пример #1
0
        private void UpdateGig(GigDetail gigDetail)
        {
            var gig = _gigRepository.Get(gigDetail.Id);
            var setlist = _setlistRepository.Get(gigDetail.SetlistId);

            if (gig != null)
            {
                gig.DateGig = Convert.ToDateTime(gigDetail.DateGig);
                gig.Venue = gigDetail.Venue;
                gig.Description = gigDetail.Description;
                gig.Setlist = setlist;
                gig.UserUpdate = _currentUser;
                gig.DateUpdate = DateTime.Now;
            };

            _gigRepository.Update(gig);
        }
Пример #2
0
        private int AddGig(GigDetail gigDetail)
        {
            var band = _bandRepository.Get(gigDetail.BandId);
            var setlist = _setlistRepository.Get(gigDetail.SetlistId);

            var g = new Gig
            {
                Band = band,
                DateGig = Convert.ToDateTime(gigDetail.DateGig),
                Venue = gigDetail.Venue,
                Description = gigDetail.Description,
                Setlist = setlist,
                UserCreate = _currentUser,
                UserUpdate = _currentUser,
                DateCreate = DateTime.Now,
                DateUpdate = DateTime.Now
            };

            return _gigRepository.Add(g);
        }