Esempio n. 1
0
        protected VetBaseViewModel(User user, IDialoger dialoger,
            ISQLSelect sqlSelect, ISQLInsert sqlInsert, ISQLUpdate sqlUpdate, ISQLDelete sqlDelete)
        {
            User = user;
            this.sqlSelect = sqlSelect;
            this.sqlInsert = sqlInsert;
            this.sqlUpdate = sqlUpdate;
            this.sqlDelete = sqlDelete;
            employee = sqlSelect.GetEmployee(User);
            this.dialoger = dialoger;

            LoadData();

            DiseasesCommand = new RelayCommand(obj => GoToDiseasePage());
            MedicalProceduresCommand = new RelayCommand(obj => GoToMedicalProceduresPage());
            ProtegesCommand = new RelayCommand(obj => GoToProtegesPage());
        }
        private CagesAndAreasPageViewModel(User user, ISQLDelete sqlDelete)
            : base(user, new SQLCredentials(), new Dialoger(), new SQLSelect(), new SQLInsert(), new SQLUpdate())
        {
            this.sqlDelete = sqlDelete;

            LoadData();

            AddCageCommand = new RelayCommand(obj => AddNewCage());
            AddAreaCommand = new RelayCommand(obj => AddNewArea());

            OpenEditAreaWindowCommand = new RelayCommand(obj => OpenEditAreaWindow());
            OpenEditCageWindowCommand = new RelayCommand(obj => OpenEditCageWindow());

            EditCageCommand = new RelayCommand(obj => EditCage());
            EditAreaCommand = new RelayCommand(obj => EditArea());
            RemoveAreaCommand = new RelayCommand(obj => RemoveArea());
            RemoveCageCommand = new RelayCommand(obj => RemoveCage());
        }
        protected RegularEmployeeBaseViewModel(User user, IDialoger dialoger,
            ISQLSelect sqlSelect, ISQLInsert sqlInsert, ISQLUpdate sqlUpdate, ISQLDelete sqlDelete)
        {
            this.dialoger = dialoger;
            this.sqlSelect = sqlSelect;
            this.sqlInsert = sqlInsert;
            this.sqlUpdate = sqlUpdate;
            this.sqlDelete = sqlDelete;

            User = user;
            employee = sqlSelect.GetEmployee(User);

            LoadData();

            FeedingCommand = new RelayCommand(obj => GoToFeedingPage());
            CleaningCommand = new RelayCommand(obj => GoToCleaningPage());
            ProtegesCommand = new RelayCommand(obj => GoToProtegesPage());
        }