Ejemplo n.º 1
0
        private void _btnchuatrasach_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DocGiaModel select = gridDoGia.SelectedItem as DocGiaModel;

                DocGia docgia = docGiaControll.GetById(select.MaDocGia);

                gridSachMuon.ItemsSource = sachMuonControll.GetSachMuonTableByDocGiaMuon(docgia, false);
                gridDoGia.RefreshData();
            }catch { }
        }
Ejemplo n.º 2
0
        private void gridDocgia_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
        {
            try
            {
                DocGiaModel select = gridDocgia.SelectedItem as DocGiaModel;

                DocGia docgia = docGiaControll.GetById(select.MaDocGia);
                _txtdiachidg.Text    = docgia.DiaChi;
                _txtkhoadg.Text      = docgia.Khoa.TenKhoa;
                _txtlopdg.Text       = docgia.Lop.TenLop;
                _txttendg.Text       = docgia.TenDocGia;
                _txttienkiguidg.Text = docgia.TienKiGui.ToString();
            }
            catch
            { }
        }
Ejemplo n.º 3
0
        private void gridDoGia_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
        {
            try
            {
                DocGiaModel select = gridDoGia.SelectedItem as DocGiaModel;

                DocGia docgia = docGiaControll.GetById(select.MaDocGia);
                _txtmadocgia.Text  = docgia.MaDocGia.ToString();
                _txttendocgia.Text = docgia.TenDocGia.ToString();
                _txtdiachi.Text    = docgia.DiaChi.ToString();
                _datengaysinh.Text = docgia.NgaySinh.ToString("MM/dd/yyyy");
                if (docgia.GioiTinh == "Nam")
                {
                    _rdnam.IsChecked = true;
                    _rdnu.IsChecked  = false;
                }
                else
                {
                    _rdnam.IsChecked = false;
                    _rdnu.IsChecked  = true;
                }
                _imagedocgia.Source = App.ConvertByteArrayToBitmapImage(docgia.ImageDocGia) != null?App.ConvertByteArrayToBitmapImage(docgia.ImageDocGia) : null;

                if (docgia.MaLop != null)
                {
                    try
                    {
                        Lop        selected = _cbblop.SelectedItem as Lop;
                        List <Lop> cboxList = _cbblop.ItemsSource as List <Lop>;
                        selected             = cboxList.SingleOrDefault(m => m.MaLop == docgia.MaLop);
                        _cbblop.SelectedItem = selected;
                    }
                    catch (Exception)
                    {
                        _cbblop.SelectedItem = null;
                    }
                }
                else
                {
                    _cbblop.SelectedItem = null;
                }
                if (docgia.MaKhoa != null)
                {
                    try
                    {
                        Khoa        selected = _cbbkhoa.SelectedItem as Khoa;
                        List <Khoa> cboxList = _cbbkhoa.ItemsSource as List <Khoa>;
                        selected = cboxList.SingleOrDefault(m => m.MaKhoa == docgia.MaKhoa);
                        _cbbkhoa.SelectedItem = selected;
                    }
                    catch (Exception)
                    {
                        _cbbkhoa.SelectedItem = null;
                    }
                }
                else
                {
                    _cbbkhoa.SelectedItem = null;
                }
                gridSachMuon.ItemsSource = sachMuonControll.GetSachMuonTableByDocGia(docgia);
                gridSachMuon.RefreshData();
            }
            catch
            { }
        }
Ejemplo n.º 4
0
 public List <DocGiaModel> GetListTableModelBySearch(string search)
 {
     return(DocGiaModel.ToListByListDocGia(_docgiaControls.GetBySearch(search)));
 }
Ejemplo n.º 5
0
 public List <DocGiaModel> GetDocGiaByListMa(List <string> ma)
 {
     return(DocGiaModel.ToListByListDocGia(_docgiaControls.getlistDocGiaByListMa(ma)));
 }