Esempio n. 1
0
        private void btnThem_Click(object sender, RoutedEventArgs e)
        {
            NhanVien nv = new NhanVien();

            nv.taikhoan = txtTK.Text;
            nv.matkhau  = "1";
            nv.tennv    = txtTen.Text;
            nv.sdt      = int.Parse(txtSDT.Text);
            nv.diachi   = txtDiachi.Text;
            nv.ngaysinh = dtpNS.SelectedDate.Value;
            if (rdoNam.IsChecked == true)
            {
                nv.gioitinh = true;
            }
            else
            {
                nv.gioitinh = false;
            }
            nv.email    = txtEmail.Text;
            nv.doanhthu = 0;
            nv.quyen    = false;
            nv.hinh     = ConvertToBytes(img.Source as BitmapImage);
            dc.NhanViens.InsertOnSubmit(nv);
            dc.SubmitChanges();
            MainWindow main = new MainWindow();
            UCNV       uc   = new UCNV();

            main.usnv.Content          = uc;
            ucl.grid.ItemsSource       = new NhanVienModelView().DSNVList;
            uc.gridControl.ItemsSource = new NhanVienModelView().DSNV;
            this.Close();
        }
Esempio n. 2
0
 private void nbiDetail_Click(object sender, System.EventArgs e)
 {
     b                   = new UCNV();
     usnv.Content        = b;
     biNV.IsEnabled      = false;
     nbiDetail.IsEnabled = false;
     nbiList.IsEnabled   = true;
 }