public TijdBerekenModuleViewModel(UnitOfWork ctx)
     : base(ctx)
 {
     Init();
     CurrentParameters = new Parameters();
     CurrentStrings = new Strings();
     LoadData();
 }
        public ParameterBeheerViewModel(UnitOfWork ctx)
            : base(ctx)
        {
            Header = "Parameterbeheer";
            ParameterData = new Parameters();
            StringsData = new Strings();
            BegroetingPrintData = new BegroetingPrint();

            WinkelData = new WinkelTypeViewModel(Ctx);
            SchoolData = new SchoolTypeViewModel(Ctx);
            BedrijfData = new BedrijfTypeViewModel(Ctx);
            OphalingData = new OphalingBeheerViewModel(Ctx);

            #region Buttons
            SaveParametersCommand = new RelayCommand(
                () => SaveParameters(),
                () => true
            );

            RefreshParametersCommand = new RelayCommand(
                () => LoadParameters(),
                () => true
            );

            SaveStringsCommand = new RelayCommand(
                () => SaveStrings(),
                () => true
            );

            RefreshStringsCommand = new RelayCommand(
                () => LoadStrings(),
                () => true
            );

            SaveBegroetingCommand = new RelayCommand(SaveBegroetingPrint);
            RefreshBegroetingCommand = new RelayCommand(LoadBegroetingPrint);
            BackupDatabaseCommand = new RelayCommand(BackupDatabase);
            RestoreDatabaseCommand = new RelayCommand(RestoreDatabase);
            #endregion
        }
        public override void Cancel()
        {
            //Reset the changes we made
            Ctx.TijdPrestaties.Refresh();
            Ctx.Klanten.Refresh();

            ////Legacy code (before Repository pattern)
            ////Maybe I need it back one day
            //using (var context = new ISIS_DataEntities())
            //{
            //    context.Entry(AddPrestatie).Reload();
            //    context.Entry(SelectedKlant).Reload();
            //}

            CurrentParameters = new Parameters();
            Init();
        }
 public void AddParameters(Parameters p)
 {
     ParameterHemden = Convert.ToDecimal(p.ParameterHemden);
     ParameterLakens1 = Convert.ToDecimal(p.ParameterLakens1);
     ParameterLakens2 = Convert.ToDecimal(p.ParameterLakens2);
     ParameterAndereStrijk = p.ParameterAndereStrijk;
 }