示例#1
0
文件: Users.cs 项目: B10S2/Shop
        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);
            }
        }