示例#1
0
        private void btnluu_Click(object sender, EventArgs e)
        {
            bool flag;

            if (rdbnam.Checked == true)
            {
                flag = true;
            }
            else
            {
                flag = false;
            }
            using (_db = new QLSQADataContext())
            {
                db_User user = new db_User
                {
                    TenNV       = txttnd.Text,
                    TenDangNhap = txttdn.Text,
                    MatKhau     = txtmk.Text,
                    EmailDK     = txtemail.Text,
                    Vaitro      = cmbvaitro.SelectedItem.ToString(),
                    GioiTinhDK  = flag,
                    NgaySinh    = dateTimePicker1.Value
                };
                _db.db_Users.InsertOnSubmit(user);
                _db.SubmitChanges();
                loadata();
            };
            MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK);
            enableNutLenh(false);
            cleardata();
        }
示例#2
0
 partial void Deletedb_User(db_User instance);
示例#3
0
 partial void Updatedb_User(db_User instance);
示例#4
0
 partial void Insertdb_User(db_User instance);