using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;

namespace Service.Implement
{
	public class RoomTypeSceneModalManager : GenericManagerBase<RoomTypeSceneModal>, IRoomTypeSceneModalManager
	{
		public IList<RoomTypeSceneModal> LoadAll(RoomTypeScene scene)
		{
			return CurrentRepository.LoadAll().Where(r => r.Scene != null && r.Scene == scene).ToList();
		}

		public void DeleteByModal(RoomTypeModal modal)
		{
			if(modal != null)
			{
				var list = CurrentRepository.LoadAll().Where(r => r.Modal == modal);

				foreach (var item in list)
				{
					CurrentRepository.Delete(item.ID);
				}
			}
		}
	}
}
