private void AddLine(object sender, RoutedEventArgs e) { var newWin = new AddLineAndPackageView(SessionUserId, Customer.UserId, this); newWin.Show(); this.Hide(); }
private void Next(object sender, RoutedEventArgs e) { #region string fName = tbxFirstName.Text; string lName = tbxLastName.Text; string password = tbxPassword.Text; string phone = tbxPhoneNumber.Text; string address = tbxAddress.Text; string email = tbxEmailAddress.Text; #endregion if (ViewModel.ValidateInput(fName, lName, password, phone, address, email)) { //Customer = new CustomerModel //{ // FirstName = tbxFirstName.Text, // LastName = tbxLastName.Text, // PhoneNumber = tbxPhoneNumber.Text, // Password = tbxPassword.Text, // Address = tbxAddress.Text, // EmailAddress = tbxEmailAddress.Text, // IsActive = true //}; var result = ViewModel.AddCustomer(fName, lName, password, phone, address, email); if (result.IsCreated) { var nextPage = new AddLineAndPackageView(SessionUserId, result.Id, PreviousWindow); nextPage.Show(); this.Close(); } else { MessageBox.Show(result.Description); } } else { ShowErrorMessages(); } }