Пример #1
0
        private void btSave_Click(object sender, EventArgs e)
        {
            try
            {
                User user = new User();
                user.FirstName = tbName.Text;
                user.LastName  = tbLastName.Text;
                user.Login     = tbLogin.Text;
                user.Pass      = this.GetHashString(tbPassword.Text);
                user.Phone     = tbPhone.Text;
                user.Role      = cbRole.SelectedItem.ToString();

                Shop.AddUser(user);
                MessageBox.Show("Сохранено!", "Информция", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.AddUsersListView();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }