Example #1
0
        public void ReturnBook(HardCopy copy)
        {
            var history = new BookLeaningHistory
            {
                HardCopyId = copy.Id,
                UserLeantTo = copy.UserLeantTo.Value,
                LeantDate = copy.LeantDate.Value,
                ReturnedDate = DateTime.Now
            };

            _libraryContext.BookLeaningHistories.InsertOnSubmit(history);
            _libraryContext.SubmitChanges();
        }
 partial void DeleteBookLeaningHistory(BookLeaningHistory instance);
 partial void UpdateBookLeaningHistory(BookLeaningHistory instance);
 partial void InsertBookLeaningHistory(BookLeaningHistory instance);
		private void detach_BookLeaningHistories(BookLeaningHistory entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_BookLeaningHistories(BookLeaningHistory entity)
		{
			this.SendPropertyChanging();
			entity.HardCopy = this;
		}