Example #1
0
        private void bRegistration_Click(object sender, EventArgs e)
        {
            RegForm regForm = new RegForm();

            if (regForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            //Успешно
            AuthenticatedUser = regForm.RegisteredUser;
            IsUserNew         = true;
            DialogResult      = DialogResult.OK;
            Close();
        }
Example #2
0
        //Добавление пользователя
        private void bAddUser_Click(object sender, EventArgs e)
        {
            var regForm = new RegForm();

            if (regForm.ShowDialog() == DialogResult.OK)
            {
                var addingUser = regForm.RegisteredUser;
                //Добавляем в таблицу
                var lvUser = new ListViewItem(items: new[] {
                    addingUser.login,
                    Convert.ToBase64String(addingUser.password_hash),
                    addingUser.salt,
                    addingUser.registration_date.ToShortDateString(),
                    addingUser.role
                });
                lvUser.Tag = addingUser;
                interfaceManager.AddItemToTable(lvUsers, lvUser);
                interfaceManager.AutoResizeListViewColumns(lvCompanies);
            }
        }