private void onModifyUser()
        {
            UserWindow lUserWindow = new UserWindow(UserWindowType.MODIFY, SelectUserEntity);

            lUserWindow.Closed += UserWindow_Closed;
            lUserWindow.Show();
        }
Example #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            UserWindow us = new UserWindow("admin");

            us.Show();
            Application.Current.Windows[0].Close();
        }
Example #3
0
 public UserViewModel(UserWindow ThisWindow)
 {
     UserCommand = new RelayCommand(o =>
     {
         ThisWindow.Close();
     });
 }
Example #4
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try {
                // set language
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");

                string root = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
                Environment.CurrentDirectory = root;

                pipe = new NamedPipeManager(Name);
                if (!pipe.SingleServer())
                {
                    if (e.Args.Length == 1)
                    {
                        pipe.Write(e.Args[0]);
                    }
                    Environment.Exit(0);
                }

                pipe.ReceiveString += pipe_ReceiveString;
                pipe.StartServer();

                var win = new UserWindow();
                win.Closed += win_Closed;
                win.Show();
            }
            catch (Exception _e) {
                MessageBox.Show(_e.Message);
                Application.Current.Shutdown();
                pipe.StopServer();
            }
        }
        private void onDoubleClickList()
        {
            UserWindow lUserWindow = new UserWindow(UserWindowType.MODIFY, SelectUserEntity);

            lUserWindow.Closed += UserWindow_Closed;
            lUserWindow.Show();
        }
Example #6
0
        public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements)
        {
            try
            {
                m_app = commandData.Application;
                m_doc = m_app.ActiveUIDocument.Document;

                UserWindow userWindow = new UserWindow();
                if ((bool)userWindow.ShowDialog())
                {
                    string projectFileId = DataStorageUtil.GetProjectFileId(m_doc).ToString();
                    if (AppCommand.Instance.Configurations.ContainsKey(projectFileId))
                    {
                        DTMConfigurations config = AppCommand.Instance.Configurations[projectFileId];

                        AdminViewModel viewModel   = new AdminViewModel(config);
                        AdminWindow    adminWindow = new AdminWindow();
                        adminWindow.DataContext = viewModel;
                        if ((bool)adminWindow.ShowDialog())
                        {
                            config = adminWindow.ViewModel.Configuration;
                            AppCommand.Instance.Configurations.Remove(projectFileId);
                            AppCommand.Instance.Configurations.Add(projectFileId, config);
                            AppCommand.Instance.ApplyConfiguration(m_doc, config);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string exMessage = ex.Message;
                MessageBox.Show("Failed to execute Admin Command.\n" + ex.Message, "Admin Command", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(Result.Succeeded);
        }
 private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (dgFurniture.Visibility.Equals(Visibility.Visible))
     {
         Furniture       copy            = (Furniture)SelectedFurniture.Clone();
         FurnitureWindow furnitureWindow = new FurnitureWindow(copy, FurnitureWindow.Operation.EDIT);
         furnitureWindow.Show();
     }
     else if (dgFurnitureType.Visibility.Equals(Visibility.Visible))
     {
         FurnitureType       copy            = (FurnitureType)SelectedFurnitureType.Clone();
         FurnitureTypeWindow furnitureWindow = new FurnitureTypeWindow(copy, FurnitureTypeWindow.Operation.EDIT);
         furnitureWindow.Show();
     }
     else if (dgSales.Visibility.Equals(Visibility.Visible))
     {
         Sale       copy       = (Sale)SelectedSale.Clone();
         SaleWindow saleWindow = new SaleWindow(copy, SaleWindow.Operation.EDIT);
         saleWindow.Show();
     }
     else if (dgUsers.Visibility.Equals(Visibility.Visible))
     {
         User       copy       = (User)SelectedUser.Clone();
         UserWindow userWindow = new UserWindow(copy, UserWindow.Operation.EDIT);
         userWindow.Show();
     }
     else if (dgAdditionalService.Visibility.Equals(Visibility.Visible))
     {
         AdditionalService       copy = (AdditionalService)SelectedAdditionalService.Clone();
         AdditionalServiceWindow additionalServiceWindow = new AdditionalServiceWindow(copy, AdditionalServiceWindow.Operation.EDIT);
         additionalServiceWindow.Show();
     }
 }
        /// <summary>
        /// Executes the add User command
        /// </summary>
        private void AddNewUserExecute(object obj)
        {
            string password = (obj as PasswordBox).Password;

            User.UserPassword = password;
            userData.AddUser(User);
            UserList = userData.GetAllUsers().ToList();

            // Login
            LoggedInUser.CurrentUser = new tblUser
            {
                UserID       = User.UserID,
                FirstName    = User.FirstName,
                LastName     = User.LastName,
                Email        = User.Email,
                Gender       = User.Gender,
                DateOfBirth  = User.DateOfBirth,
                UserLocation = User.UserLocation,
                Username     = User.Username,
                UserPassword = PasswordHasher.Hash(User.UserPassword)
            };

            ViewRegistration = Visibility.Collapsed;
            UserWindow userWindow = new UserWindow();

            view.Close();
            userWindow.Show();
        }
Example #9
0
        private void EnterSearch(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (this.DataGridUsers.Items.Count == 1)
                {
                    DataRow       selected = ((DataRowView)this.DataGridUsers.Items.GetItemAt(0)).Row;
                    List <string> toSend   = new List <string>();
                    foreach (DataColumn dc in this._dt.Columns)
                    {
                        toSend.Add(selected[dc].ToString());
                    }
                    UserWindow userWindow = new UserWindow(false, this._mainWindowImpl.GetEventFieldUserByValues(toSend), this._idEvent);
                    userWindow.ShowDialog();
                }
            }

            else if (e.Key == Key.Back || e.Key == Key.Delete)
            {
                this._mainWindowImpl.SetDeleteButton(true);
            }

            else
            {
                this._mainWindowImpl.SetDeleteButton(false);
            }
        }
Example #10
0
        private void SetUpProfileButton_Click(object sender, RoutedEventArgs e)
        {
            // Constarins to make sure that all fields are filled
            if (string.IsNullOrWhiteSpace(HeightTextBox.Text) ||
                string.IsNullOrWhiteSpace(WeightTextBox.Text) ||
                string.IsNullOrWhiteSpace(TargetWeightTextBox.Text) ||
                string.IsNullOrWhiteSpace(KilosToLosePerWeekTextBox.Text) ||
                string.IsNullOrWhiteSpace(WorkoutsPerWeekTextBox.Text) ||
                string.IsNullOrWhiteSpace(WorkoutHoursPerDayTextBox.Text))
            {
                SigningWindow.SigningWindowObject.ErrorsSnackbar.MessageQueue.Enqueue("All fields are required!");
            }

            else
            {
                // Signing up
                Database.AddUser(profilePhoto.ByteArray,
                                 SigningWindow.SignUpPageObject.FirstNameTextBox.Text,
                                 SigningWindow.SignUpPageObject.LastNameTextBox.Text,
                                 SigningWindow.SignUpPageObject.EmailTextBox.Text,
                                 SigningWindow.SignUpPageObject.Password,
                                 SigningWindow.SignUpPageObject.GenderComboBox.Text,
                                 SigningWindow.SignUpPageObject.BirthDatePicker.SelectedDate,
                                 double.Parse(WeightTextBox.Text),
                                 double.Parse(HeightTextBox.Text),
                                 double.Parse(TargetWeightTextBox.Text),
                                 double.Parse(KilosToLosePerWeekTextBox.Text),
                                 double.Parse(WorkoutsPerWeekTextBox.Text),
                                 double.Parse(WorkoutHoursPerDayTextBox.Text));

                UserWindow UserWindowTemp = new UserWindow(Database.AccountID);
                SigningWindow.SigningWindowObject.Close();
                UserWindowTemp.Show();
            }
        }
Example #11
0
        private void ShowUpdateNeededUIInner(NetSparkleAppCastItem[] updates)
        {
            if (UserWindow != null)
            {
                Debug.WriteLine("ShowUpdateNeededUIInner: User window is not null - clearing events");
                // remove old user window
                UserWindow.UserResponded -= OnUserWindowUserResponded;
            }

            // create the form
            Debug.WriteLine("ShowUpdateNeededUIInner: Creating new sparkle form");
            UserWindow = UIFactory.CreateSparkleForm(updates, _applicationIcon);

            if (HideReleaseNotes)
            {
                Debug.WriteLine("ShowUpdateNeededUIInner: Hiding release notes");
                UserWindow.HideReleaseNotes();
            }

            // clear if already set.
            Debug.WriteLine("ShowUpdateNeededUIInner: Setting user window event handle events");
            UserWindow.UserResponded += OnUserWindowUserResponded;
            Application.DoEvents();
            Debug.WriteLine("ShowUpdateNeededUIInner: Showing window");

            UserWindow.Show();
        }
Example #12
0
        private void Button_Cancel_Click(object sender, RoutedEventArgs e)
        {
            var window = new UserWindow();

            window.Show();
            Close();
        }
Example #13
0
        private void Button_ClickUser(object sender, RoutedEventArgs e)
        {
            UserWindow userWindow = new UserWindow();

            userWindow.Show();
            this.Close();
        }
Example #14
0
        /// <summary>
        /// Constructor with User Window param
        /// </summary>
        /// <param name="userOpen">opens the user window</param>
        public UserViewModel(UserWindow userOpen)
        {
            userWindow = userOpen;
            UserList   = new ObservableCollection <tblUser>(userData.GetAllUsers().ToList());
            locationData.GetAllLocations().ToList();

            bgWorker.DoWork += WorkerOnDoWorkDelete;
        }
Example #15
0
        private void Details()
        {
            UserWindow uw = new UserWindow();

            uw.DataContext = this;

            uw.Show();
        }
 private void InitializeUserWindowCommand()
 {
     UserWindowCommand = new RelayCommand <object>(
         sender => { return(true); }, sender =>
     {
         UserWindow userWindow = new UserWindow();
         userWindow.ShowDialog();
     });
 }
Example #17
0
        public void CreateNewUser()
        {
            var w = new UserWindow();

            if (w.ShowDialog() == true)
            {
                AddUser(w.UserName, w.Email, w.Bitmap);
            }
        }
Example #18
0
        private void EditStudentButton_Click(object sender, RoutedEventArgs e)
        {
            UserWindow window = new UserWindow(_groupNow, ((Button)sender).Tag as string);

            if ((bool)window.ShowDialog())
            {
                InitializeStudentsEditPanelContent();
            }
        }
 private void ChangeGameMode(object sender, RoutedEventArgs args)
 {
     UserWindow = UserWindow ?? new UserGameWindow(LoginData.GetInstance())
     {
         Owner = this
     };
     UserWindow.Show();
     Hide();
 }
Example #20
0
        public MainViewModel()
        {
            LoadedWindowCommand = new RelayCommand <Window>((p) => { return(true); }, (p) => {
                isLoaded = true;
                if (p == null)
                {
                    return;
                }
                p.Hide();
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();
                if (loginWindow.DataContext == null)
                {
                    return;
                }
                var loginVM = loginWindow.DataContext as LoginViewModel;
                if (loginVM.IsLogin)
                {
                    p.Show();
                }
                else
                {
                    p.Close();
                }
            });

            SuplierWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                SuplierWindow window = new SuplierWindow();
                window.ShowDialog();
            });

            CustomerWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                CustomerWindow window = new CustomerWindow();
                window.ShowDialog();
            });

            ObjectWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                ObjectWindow window = new ObjectWindow();
                window.ShowDialog();
            });

            UserWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                UserWindow window = new UserWindow();
                window.ShowDialog();
            });

            InputWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                InputWindow window = new InputWindow();
                window.ShowDialog();
            });

            OutputWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                OutputWindow window = new OutputWindow();
                window.ShowDialog();
            });
        }
    public void ShowUserWindow(UserViewModel userViewModel)
    {
        UserWindow = new UserWindow
        {
            DataContext = userViewModel
        };

        LoginWindow.Hide();
        UserWindow.Show();
    }
Example #22
0
        private void LoginGuest_Click(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.CurrentUserType = DataManager.UserType.Guest;

            this.Hide();

            var window = new UserWindow();

            window.ShowDialog();
        }
        public void Execute(object parameter)
        {
            UserViewModel userViewModel = new UserViewModel();
            var           items         = App.DB.UserRepository.GetAllData();

            userViewModel.AllUsers = items;
            UserWindow userWindow = new UserWindow(userViewModel);

            userWindow.ShowDialog();
        }
        //add new
        private void AddUser_Click(object sender, RoutedEventArgs e)
        {
            var user = new User();
            var add  = new UserWindow("Register", user, me);

            add.ShowDialog();

            what = "users";
            SetDataGrid();
        }
Example #25
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            users us = new users();

            us.initialize();
            UserWindow u = new UserWindow(us.userName[(us.index - 1)]);

            u.Show();
            Application.Current.Windows[0].Close();
        }
 /// <summary>
 /// Constructor with UserWindow param
 /// </summary>
 /// <param name="UserWindow">opens the users window</param>
 public UserViewModel(UserWindow usersOpen)
 {
     userWindow       = usersOpen;
     OrderList        = service.GetAllUserOrders(LoggedUser.CurrentUser.UserID).ToList();
     ItemList         = service.GetAllItems().ToList();
     ShoppingCartList = service.GetAllUserShoppingCarts(LoggedUser.CurrentUser.UserID).ToList();
     UserList         = service.GetAllUsers().ToList();
     InfoText();
     CheckIfCartEmpty();
 }
Example #27
0
        private void NewUserInfo(object sender, RoutedEventArgs e)
        {
            UserWindow userWindow = new UserWindow(true, this._mainWindowImpl.GetAllFieldsOfEvent(this._idEvent), this._idEvent);
            bool       onClose    = userWindow.ShowDialog().Value;

            if (onClose)
            {
                this.CreateRowsDataGrid(this._mainWindowImpl.RefreshMainsFields());
                this.ShowNotification("User added");
            }
        }
Example #28
0
        //用户数据相关
        /// <summary>
        /// 点击用户头像
        /// </summary>
        public void DisplayUser()
        {
            UserWindow window = new UserWindow(_userData as UserData)
            {
                Owner = _window
            };                                                                            //TODO

            FocusedAction(() => {
                window.ShowDialog();
            });
        }
        private void onAddUser()
        {
            AddUserEntity = new UserEntity();
            DocumentManager.Web.Model.user user = new DocumentManager.Web.Model.user();
            AddUserEntity.User = user;
            user.user_password = Cryptography.MD5CryptoServiceProvider.GetMd5String("123456");
            AddUserEntity.Update();
            UserWindow lUserWindow = new UserWindow(UserWindowType.MODIFY, AddUserEntity);

            lUserWindow.Closed += AddUser_Closed;
            lUserWindow.Show();
        }
        private void UserWindow_Closed(object sender, EventArgs e)
        {
            UserWindow lUserWindow = sender as UserWindow;

            if (lUserWindow.DialogResult == true)
            {
                IsBusy = true;
                Log.AddLog(documentManagerContext, SelectUserEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
 private void btnUsers_Click(object sender, RoutedEventArgs e)
 {
     UserWindow userWindow = new UserWindow();
 }
Example #32
0
 public static void start_UserGUI()            // Метод запускающий пользовательский интерфейс
 {
     var userWindow = new UserWindow();
     userWindow.Show();
     System.Windows.Threading.Dispatcher.Run();
 }