using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;

namespace BeWo.View.Navigation.Filter
{
    public class CustomerNavigationFilter : CustomFilter
    {
        public bool ShowOnlyMyCustomers { get; set; }

        public override bool IsValid(IFilterableDC dc)
        {
            var custDC = dc as CompactCustomerDC;

            if (ShowOnlyMyCustomers && custDC != null)
            {
                return custDC.IsRelatedToEmployee;
            }

            return true;
        }
    }
}