public UsageEntryViewModel(IMessageBroker messageBroker, IConsumableUsageService usageService,
            IHenHouseService houseService, IConsumableService consumableService,
            SaveUsageCommand saveUsageCommand, CancelCommand cancelCommand, ShowUsageCommand showListCommand
            )
        {
            this.messageBroker = messageBroker;
            this.usageService = usageService;
            this.houseService = houseService;
            this.consumableService = consumableService;

            this.saveUsageCommand = saveUsageCommand;
            this.showListCommand = showListCommand;

            CancelCommand = cancelCommand;

            PropertiesToValidate = new List<string>()
            {
                "Date",
                "Total",
                "Details"
            };

            InitializeCommands();

            HouseList = new ObservableCollection<HenHouse>(houseService.GetAll());
            ConsumableList = new ObservableCollection<Consumable>(consumableService.GetAll());

            SubscribeMessages();
        }
        public EmployeeCostEntryViewModel(
            IMessageBroker messageBroker, 
            IEmployeeCostService costService,
            IEmployeeService employeeService,
            SaveEmployeeCostCommand saveCostCommand,
            CancelCommand cancelCommand, ShowEmployeeCostCommand showListCommand
            )
        {
            this.messageBroker = messageBroker;
            this.costService = costService;
            this.employeeService = employeeService;
            ActualSaveCommand = saveCostCommand;

            CancelCommand = cancelCommand;
            ShowCostListCommand = showListCommand;
            InitializeCommands();
            NavigationCommands = new List<CommandBase>{SaveCommand,CancelCommand};
            CancelCommand.Action = broker => showListCommand.Execute(null);

            PropertiesToValidate = new List<string>()
            {
                "Date",
                "Total",
                "Details"
            };

            Employees = new ObservableCollection<Employee>(employeeService.GetAll());

            SubscribeMessages();
        }
        public HenDepreciationEntryViewModel(IMessageBroker messageBroker, IHenDepreciationService service, IHenHouseService houseService,
            SaveHenDepreciationCommand saveCommand, CancelCommand cancelCommand, ShowHenDepreciationListCommand showListCommand)
        {
            this.broker = messageBroker;
            this.service = service;

            ActualSaveCommand = saveCommand;

            CancelCommand = cancelCommand;
            CancelCommand.Action = b => showListCommand.Execute(null);

            RefreshCommand = new DelegateCommand(p => OnRefresh(),p => true) {Text = () => LanguageData.General_Refresh};

            ShowListCommand = showListCommand;

            HenHouses = new ObservableCollection<HenHouse>(houseService.GetAll().OrderBy(h => h.Name));

            InitializeCommands();

            PropertiesToValidate = new List<string>
            {
                "Date",
                "Details"
            };

            NavigationCommands = new List<CommandBase>(){SaveCommand, CancelCommand, RefreshCommand};

            SubscribeMessages();
        }
        public AdditionalCostEntryViewModel(IMessageBroker broker, IAdditionalCostService costService,
                                            SaveAdditionalCostCommand saveCommand, CancelCommand cancelCommand)
        {
            this.broker = broker;
            this.costService = costService;

            ActualSaveCommand = saveCommand;
            CancelCommand = cancelCommand;

            PropertiesToValidate = new List<string> { "Id","Name","Value"};

            InitializeCommands();
            SubscribeMessages();
        }
        public EmployeeEntryViewModel(IMessageBroker messageBroker, IEmployeeService employeeService,
                                      SaveEmployeeCommand saveCommand, CancelCommand cancelCommand)
        {
            this.employeeService = employeeService;
            this.messageBroker = messageBroker;

            PropertiesToValidate = new List<string> {"Name", "Salary"};

            ActualSaveCommand = saveCommand;
            CancelCommand = cancelCommand;

            InitializeCommands();
            SubscribeMessages();
        }
        public HouseEntryViewModel(IMessageBroker messageBroker, IHenHouseService houseService,
            SaveHenHouseCommand saveCommand, CancelCommand cancelCommand)
        {
            this.houseService = houseService;
            this.messageBroker = messageBroker;

            ActualSaveCommand = saveCommand;
            SubscribeMessages();

            PropertiesToValidate = new List<string>
                {
                    "Name",
                    "PurchaseCost",
                    "YearUsage",
                    "ProductiveAge"
                };

            CancelCommand = cancelCommand;
            InitializeCommands();
        }
        public ConsumableEntryViewModel(IMessageBroker messageBroker, IConsumableService consumableService, 
            SaveConsumableCommand saveCommand, CancelCommand cancelCommand)
        {
            this.consumableService = consumableService;
            this.messageBroker = messageBroker;

            ActualSaveCommand = saveCommand;
            CancelCommand = cancelCommand;

            ConsumableTypes = new List<Tuple<byte, string>>()
                {
                    Tuple.Create((byte)ConsumableType.Feed, LanguageData.ConsumableType_Feed),
                    Tuple.Create((byte)ConsumableType.Ovk, LanguageData.ConsumableType_Ovk)
                };

            PropertiesToValidate = new List<string>() { "Name", "UnitPrice" };

            InitializeCommands();
            SubscribeMessages();
        }
        public EggProductionEntryViewModel(IMessageBroker broker, IEggProductionService service,IConsumableUsageService usageService,
            IHenHouseService houseService, SaveEggProductionCommand saveCommand, CancelCommand cancelCommand,
            ShowEggProductionListCommand showListCommand)
        {
            this.broker = broker;
            this.service = service;
            this.usageService = usageService;
            ActualSaveCommand = saveCommand;

            CancelCommand = cancelCommand;
            ShowListCommand = showListCommand;

            PropertiesToValidate = new List<string> { "Date", "Details" };

            InitializeCommands();
            NavigationCommands =new List<CommandBase>(){SaveCommand, CancelCommand, RefreshCommand};
            CancelCommand.Action = b => showListCommand.Execute(null);

            HenHouses = new ObservableCollection<HenHouse>(houseService.GetAll().OrderBy(h => h.Name));

            SubscribeMessages();
        }
        public HenEntryViewModel(IMessageBroker messageBroker, IHenService henService, IHenHouseService houseService,
            SaveHenCommand saveCommand, CancelCommand cancelCommand)
        {
            this.henService = henService;
            this.messageBroker = messageBroker;
            this.houseService = houseService;

            ActualSaveCommand = saveCommand;
            CancelCommand = cancelCommand;

            PropertiesToValidate = new List<string>
                {
                    "Name",
                    "Type",
                    "HouseId"
                };

            OnRefreshHouseList(null);

            InitializeCommands();
            SubscribeMessages();
        }