Beispiel #1
0
        private void ToCustomer()
        {
            var msg = new ChangePageHelper()
            {
                PageName = new UserLoginViewModel()
            };

            Messenger.Default.Send <ChangePageHelper>(msg);
        }
Beispiel #2
0
        private void ToAccount()
        {
            var msg = new ChangePageHelper()
            {
                PageName = new WorkerPanelViewModel()
            };

            Messenger.Default.Send <ChangePageHelper>(msg);
        }
Beispiel #3
0
        private void ToAccount()
        {
            var msg = new ChangePageHelper()
            {
                PageName = new UserOrderViewModel()
            };

            Messenger.Default.Send <ChangePageHelper>(msg);

            //var msg2 = new ChangePanelHelper() { panelType = PanelType.User };
            //Messenger.Default.Send<ChangePanelHelper>(msg2);
        }
 private void ToAccount()
 {
     var msg = new ChangePageHelper() { PageName = new WorkerPanelViewModel() };
     Messenger.Default.Send<ChangePageHelper>(msg);
 }
Beispiel #5
0
        private async void ToCustomer(object parameter)
        {
            var passwordBox = parameter as PasswordBox;
            var password = passwordBox.Password;
            Password = password;
            ValidateRegistry();
            if (validationErrors.Count == 0)
            {
                //using (MobilekEntities entities = new MobilekEntities())
                {
                    var hash = SecurePasswordHasher.Hash(password);
                    CustomerDTO customer = new CustomerDTO()
                    {
                        firstName = FirstName,
                        lastName = Surname,
                        creditCardNumber = CreditCardNr,
                        pesel = Pesel,
                        phoneNumber = PhoneNr,
                        userName = UserName,
                        password = hash,
                        email = Email
                    };
                    //entities.Customers.Add(customer);
                    //entities.SaveChanges();
                    var service = new Mobilek.Services.CustomerDTOService("", "");
                    await service.Post(customer);
                }
                RegistrationSuccessful = "User name: " + UserName + " was successfully added";
                FirstName = ""; Surname = ""; Email = ""; PhoneNr = ""; Pesel = ""; CreditCardNr = "";
                Password = ""; RepeatPassword = ""; UserName = ""; Login_Password = ""; Login_UserName = "";
                var msg = new ChangePageHelper() { PageName = new UserLoginViewModel() };
                Messenger.Default.Send<ChangePageHelper>(msg);
            }

        }
Beispiel #6
0
        private async void ToAccount(object parameter)
        {
            var passwordBox = parameter as PasswordBox;
            var password = passwordBox.Password;
            Login_Password = password;
            ValidateLogin();
            if (validationErrors.Count == 0)
            {
                CustomerDTO customer = new CustomerDTO();
                var service = new Mobilek.Services.CustomerDTOService(Login_UserName, Login_Password);
                var users = await service.Get();
                customer = users.FirstOrDefault(x => x.userName == Login_UserName);

                var msg = new ChangePageHelper() { PageName = new UserPanelViewModel(customer) };
                Messenger.Default.Send<ChangePageHelper>(msg);

            }
            //var msg2 = new ChangePanelHelper() { panelType = PanelType.User };
            //Messenger.Default.Send<ChangePanelHelper>(msg2); 
        }
Beispiel #7
0
 private void ToWelcomeView()
 {
     var msg = new ChangePageHelper() { PageName = new WelcomeViewModel() };
     Messenger.Default.Send<ChangePageHelper>(msg);
 }
Beispiel #8
0
 private void ToWorker()
 {
     var msg = new ChangePageHelper() { PageName = new WorkerLoginViewModel() };
     Messenger.Default.Send<ChangePageHelper>(msg);
 }
        private void ToAccount()
        {
            var msg = new ChangePageHelper() { PageName = new UserOrderViewModel() };
            Messenger.Default.Send<ChangePageHelper>(msg);

            //var msg2 = new ChangePanelHelper() { panelType = PanelType.User };
            //Messenger.Default.Send<ChangePanelHelper>(msg2);
        }
Beispiel #10
0
        private void ToAccount(object parameter)
        {
            var passwordBox = parameter as PasswordBox;
            var password = passwordBox.Password;
            Login_Password = password;
            Validate();
            if (validationErrors.Count == 0)
            {
                WorkerDTO w;
                {
                    //var service = new Mobilek.Services.WorkerDTOService();
                    //var users = Task.Run(() => service.Get()).Result;
                    //w = users.Single(s => s.login == Login_UserName);
                    w = Task.Run(() => service.Get(Login_UserName)).Result;
                }
                var msg = new ChangePageHelper() { PageName = new WorkerPanelViewModel(w) };
                Messenger.Default.Send<ChangePageHelper>(msg);
            }

        }