示例#1
0
        private void CommandBinding_Executed_themSV(object sender, ExecutedRoutedEventArgs e)
        {
            PHONG    k = (PHONG)cmbMaphong.SelectedItem;
            SINHVIEN a = new SINHVIEN();

            a.masv     = txtMasv.Text;
            a.maphong  = k.maphong;
            a.tensv    = txtTensv.Text;
            a.ngaysinh = dpNgaysinh.SelectedDate;
            if (rdoNam.IsChecked == true)
            {
                a.gioitinh = true;
            }
            else
            {
                a.gioitinh = false;
            }
            a.lop       = txtLop.Text;
            a.quequan   = txtQuequan.Text;
            a.dienthoai = txtDienthoai.Text;
            a.tinhtrang = true;

            xl.them(a);

            dgDSSVDango.ItemsSource = xl.getDSSinhienViewDango();
            dgDSSVDao.ItemsSource   = xl.getDSSinhienViewDao();
            QuanLyHopDong hd = new QuanLyHopDong();

            hd.txtMahd.Text = xlhd.taomahd(DateTime.Now, txtMasv.Text);
            hd.txtMasv.Text = txtMasv.Text;
            hd.Show();
        }
        private void menuHopdong_Click(object sender, RoutedEventArgs e)
        {
            QuanLyHopDong hd = new QuanLyHopDong();

            hd.Show();
        }