using System.Collections.Generic;

namespace WpfApp1.SQL
{
    class Base
    {
        public static Entities EM = new Entities();
    }

    class Items
    {
        public static List<string> sortList = new List<string> { "Наименование", "Размер скидки", "Приоритет агента" };
    }


    public partial class Agent
    {
        public string GetTypeTitle
        {
            get => Title + " | " + AgentType.Title;
        }

        public string GetPriority
        {
            get => Priority.ToString("Приоритетность: #");
        }

        public string GetImage
        {
            get => (Logo == null) ? "\\agents\\picture.png" : Logo;
        }
    }

    public partial class Product
    {
        public int GetCostWithDiscount
        {
            get
            {
                if (MinCostForAgent >= 10000 && MinCostForAgent <= 50000)
                    return 5;
                else if (MinCostForAgent >= 50000 && MinCostForAgent <= 150000)
                    return 10;
                else if (MinCostForAgent >= 150000 && MinCostForAgent <= 500000)
                    return 20;
                else if (MinCostForAgent >= 500000)
                    return 25;
                else
                    return 0;
            }
        }
    }
}