private void AddNewNguoidung() { TaiKhoanDN sv = new TaiKhoanDN(); sv.MaTS = (txtMaNguoidung.Text); sv.TenDangnhap = (txtHoTen.Text); sv.Matkhau = (txtMatkhau.Text); sv.NgaySinh = (txtNgaySinh.Text); if (rbNamDK.IsChecked == true) { sv.GioiTinh = "Nam"; } if (rbNuDK.IsChecked == true) { sv.GioiTinh = "Nữ"; } context.TaiKhoanDNs.InsertOnSubmit(sv); context.SubmitChanges(); }
public thi(string hoten, string dethi, string doithi) { InitializeComponent(); _hoten1 = hoten; _dethi = dethi; _Doithi = doithi; lbHoTenTTNC.Text = _hoten1; txtloaide.Text = _dethi; txtdoithi.Text = _Doithi; DataClasses1DataContext context = new DataClasses1DataContext(); TaiKhoanDN data = context.TaiKhoanDNs.Single(t => t.TenDangnhap == _hoten1); txtmathisinh.Text = data.MaTS; //CauHoi(); Timer = new DispatcherTimer(); Timer.Interval = new TimeSpan(0, 0, 1); Timer.Tick += Timer_Tick1; //Timer.Start(); }
private void Update() { TaiKhoanDN sv = context.TaiKhoanDNs.Single(item => item.MaTS == (txtMaNguoidung.Text)); if (sv.MaTS != txtMaNguoidung.Text) { MessageBox.Show("Không được sửa Mã Người Dùng"); } sv.TenDangnhap = (txtHoTen.Text); sv.Matkhau = (txtMatkhau.Text); sv.NgaySinh = (txtNgaySinh.Text); if (rbNamDK.IsChecked == true) { sv.GioiTinh = "Nam"; } if (rbNuDK.IsChecked == true) { sv.GioiTinh = "Nữ"; } sv.Quyen = (txtquyen.Text); context.SubmitChanges(); }
private void data1() { DataClasses1DataContext context = new DataClasses1DataContext(); TaiKhoanDN data = context.TaiKhoanDNs.Single(t => t.TenDangnhap == _hoten); }
partial void DeleteTaiKhoanDN(TaiKhoanDN instance);
partial void UpdateTaiKhoanDN(TaiKhoanDN instance);
partial void InsertTaiKhoanDN(TaiKhoanDN instance);