Esempio n. 1
0
 public RegistrationViewModel(IWindowFactory windowFactory, IWindowController windowController, IRegistration registration)
     : base(windowFactory, windowController)
 {
     this.registration    = registration;
     register             = new RelayCommand(RegisterExecute, _ => CanExecuteRegister);
     cancel               = new RelayCommand((obj) => WindowController.CloseWindow());
     passwordChanged      = new RelayCommand((obj) => Password = (obj as PasswordBox).Password);
     passwordAgainChanged = new RelayCommand((obj) => PasswordAgain = (obj as PasswordBox).Password);
 }
Esempio n. 2
0
 private void ReadyExecute(object obj)
 {
     dataManager.SetUserDailyActivity(id, customData.DailyActivity);
     dataManager.SetUserPurposeActivity(id, customData.PurposeActivity);
     dataManager.SetUserGender(id, customData.Gender);
     dataManager.SetUserHeight(id, customData.Height);
     dataManager.SetUserWeight(id, customData.Weight);
     dataManager.SetUserAge(id, Age);
     WindowController.CloseWindow();
 }
 private void ReadyExecute(object obj)
 {
     if (!edit)
     {
         dataManager.AddProduct(productModel);
     }
     else
     {
         dataManager.SetProductData(name, productModel);
     }
     WindowController.CloseWindow();
 }
Esempio n. 4
0
 private void ReadyExecute(object obj)
 {
     if (!edit)
     {
         dataManager.AddDish(dishModel);
     }
     else
     {
         dataManager.SetDishData(name, dishModel);
     }
     WindowController.CloseWindow();
 }
Esempio n. 5
0
 private void ReadyExecute(object obj)
 {
     scheduleModel.DayOfWeek = DateCharacteristic.ParseDaysOfWeek(selectedDayOfWeek);
     scheduleModel.Hour      = DateCharacteristic.ParseHourse(selectedHour);
     scheduleModel.Minute    = DateCharacteristic.ParseMinute(selectedMinute);
     if (!edit)
     {
         dataManager.AddSchedule(scheduleModel);
     }
     else
     {
         dataManager.SetScheduleData(scheduleModel.UserId, scheduleModel.Id, scheduleModel);
     }
     WindowController.CloseWindow();
 }
Esempio n. 6
0
        public void EnterExecute(object obj)
        {
            int id = authorization.Login(login, password);

            if (id != -1)
            {
                CanExecuteOnClosed = false;
                WindowController.CloseWindow();
                WindowFactory.CreateRationWindow(id);
            }
            else
            {
                Error = L10n.Resource.LOG_ERROR;
            }
        }
Esempio n. 7
0
 public void RegisterExecute(object obj)
 {
     registration.Register(user);
     WindowController.CloseWindow();
 }
 private void CancelExecute(object obj)
 {
     WindowController.CloseWindow();
 }
Esempio n. 9
0
 public WeightEnterViewModel(IWindowController windowController, IFood food)
     : base(windowController)
 {
     weight = food.Weight;
     add    = new RelayCommand(_ => { CalculatorNutrients.RecalucalteFoodByWeight(food, weight); WindowController.CloseWindow(); }, _ => CanReadyExecute);
 }