public ViewALLCB GetThongTin1DangVien(string username, string password, int MaCB) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { ViewALLCB DangVien = (from c in db.ViewALLCBs where c.ID == MaCB select c).FirstOrDefault(); return(DangVien); } else { return(null); } } catch (Exception ex) { return(null); } }
public void BindCombobox(ServiceCanBo es, ViewALLCB item) { if (item == null) { item = new ViewALLCB(); } txtTinhTrangSucKhoe.DataSource = es.TinhTrangSucKhoe("TheBinh", "12345678"); txtTinhTrangSucKhoe.DataBind(); txtTinhTrangSucKhoe.DataTextField = "TenTinhTrangSucKhoe"; txtTinhTrangSucKhoe.DataValueField = "TenTinhTrangSucKhoe"; txtTinhTrangSucKhoe.DataBind(); txtTinhTrangSucKhoe.Text = item.TinhTrangSucKhoe; txtLaThuongBinh.DataSource = es.ThuongBinh("TheBinh", "12345678"); txtLaThuongBinh.DataBind(); txtLaThuongBinh.DataTextField = "TenLoaiThuongBinh"; txtLaThuongBinh.DataValueField = "TenLoaiThuongBinh"; txtLaThuongBinh.DataBind(); txtLaThuongBinh.Text = item.LaThuongBinh; txtQuanHamCaoNhat.DataSource = es.QuanHamCaoNhat("TheBinh", "12345678"); txtQuanHamCaoNhat.DataBind(); txtQuanHamCaoNhat.DataTextField = "TenQuanHamCaoNhat"; txtQuanHamCaoNhat.DataValueField = "TenQuanHamCaoNhat"; txtQuanHamCaoNhat.DataBind(); txtQuanHamCaoNhat.Text = item.QuanHamCaoNhat; txtTrinhDoHocVan.DataSource = es.TrinhDoHocVan("TheBinh", "12345678"); txtTrinhDoHocVan.DataBind(); txtTrinhDoHocVan.DataTextField = "TenTrinhDoHocVan"; txtTrinhDoHocVan.DataValueField = "TenTrinhDoHocVan"; txtTrinhDoHocVan.DataBind(); txtTrinhDoHocVan.Text = item.TrinhDoHocVan; txtHocHam.DataSource = es.HocHam("TheBinh", "12345678"); txtHocHam.DataBind(); txtHocHam.DataTextField = "TenHocHam"; txtHocHam.DataValueField = "TenHocHam"; txtHocHam.DataBind(); txtHocHam.Text = item.HocHam; txtHocVi.DataSource = es.HocVi("TheBinh", "12345678"); txtHocVi.DataBind(); txtHocVi.DataTextField = "TenHocVi"; txtHocVi.DataValueField = "TenHocVi"; txtHocVi.DataBind(); txtHocVi.Text = item.HocVi; txtTrinhDoQuanLyNhaNuoc.DataSource = es.TrinhDoQuanLyNhaNuoc("TheBinh", "12345678"); txtTrinhDoQuanLyNhaNuoc.DataBind(); txtTrinhDoQuanLyNhaNuoc.DataTextField = "TenTrinhDoQuanLyNhaNuoc"; txtTrinhDoQuanLyNhaNuoc.DataValueField = "TenTrinhDoQuanLyNhaNuoc"; txtTrinhDoQuanLyNhaNuoc.DataBind(); txtTrinhDoQuanLyNhaNuoc.Text = item.TrinhDoQuanLyNhaNuoc; txtTrinhDoLyLuanChinhTri.DataSource = es.TrinhDoLyLuanChinhTri("TheBinh", "12345678"); txtTrinhDoLyLuanChinhTri.DataBind(); txtTrinhDoLyLuanChinhTri.DataTextField = "TenTrinhDoLyLuanChinhTri"; txtTrinhDoLyLuanChinhTri.DataValueField = "TenTrinhDoLyLuanChinhTri"; txtTrinhDoLyLuanChinhTri.DataBind(); txtTrinhDoLyLuanChinhTri.Text = item.TrinhDoLyLuanChinhTri; txtDanToc.DataSource = es.DanToc("TheBinh", "12345678"); txtDanToc.DataBind(); txtDanToc.DataTextField = "TenDanToc"; txtDanToc.DataValueField = "TenDanToc"; txtDanToc.DataBind(); txtDanToc.Text = item.DanToc; txtTonGiao.DataSource = es.TonGiao("TheBinh", "12345678"); txtTonGiao.DataBind(); txtTonGiao.DataTextField = "TenTonGiao"; txtTonGiao.DataValueField = "TenTonGiao"; txtTonGiao.DataBind(); txtTonGiao.Text = item.TonGiao; txtGioiTinh.DataSource = es.GioiTinh("TheBinh", "12345678"); txtGioiTinh.DataBind(); txtGioiTinh.DataTextField = "TenGioiTinh"; txtGioiTinh.DataValueField = "TenGioiTinh"; txtGioiTinh.DataBind(); txtGioiTinh.Text = item.GioiTinh; txtThanhPhanGiaDinh.DataSource = es.ThanhPhanGiaDinh("TheBinh", "12345678"); txtThanhPhanGiaDinh.DataBind(); txtThanhPhanGiaDinh.DataTextField = "TenTPGiaDinh"; txtThanhPhanGiaDinh.DataValueField = "TenTPGiaDinh"; txtThanhPhanGiaDinh.DataBind(); txtThanhPhanGiaDinh.Text = item.ThanhPhanGiaDinh; txtNgheNghiepKhiTuyenDung.DataSource = es.NgheNghiepKhiTuyenDung("TheBinh", "12345678"); txtNgheNghiepKhiTuyenDung.DataBind(); txtNgheNghiepKhiTuyenDung.DataTextField = "TenNgheNghiepKhiTuyenDung"; txtNgheNghiepKhiTuyenDung.DataValueField = "TenNgheNghiepKhiTuyenDung"; txtNgheNghiepKhiTuyenDung.DataBind(); txtNgheNghiepKhiTuyenDung.Text = item.NgheNghiepKhiTuyenDung; txtCongViecChinhDangLam.DataSource = es.CongViecChinhDangLam("TheBinh", "12345678"); txtCongViecChinhDangLam.DataBind(); txtCongViecChinhDangLam.DataTextField = "TenCongViecChinhDangLam"; txtCongViecChinhDangLam.DataValueField = "TenCongViecChinhDangLam"; txtCongViecChinhDangLam.DataBind(); txtCongViecChinhDangLam.Text = item.CongViecChinhDangLam; txtQueQuanTinh.DataSource = es.LoadTinh("TheBinh", "12345678"); txtQueQuanTinh.DataBind(); txtQueQuanTinh.DataTextField = "NAME"; txtQueQuanTinh.DataValueField = "ID"; txtQueQuanTinh.DataBind(); txtQueQuanTinh.Text = item.QueQuanTinh; int t = Convert.ToInt32(txtQueQuanTinh.SelectedItem.Value); txtQueQuanHuyen.DataSource = es.LoadHuyen("TheBinh", "12345678", t); txtQueQuanHuyen.DataBind(); txtQueQuanHuyen.DataTextField = "NAME"; txtQueQuanHuyen.DataValueField = "ID"; txtQueQuanHuyen.DataBind(); txtQueQuanHuyen.Text = item.QueQuanHuyen; txtQueQuanXa.DataSource = es.LoadXa("TheBinh", "12345678", Common.TryParseObjectToInt(item.QueQuanHuyen)); txtQueQuanXa.DataBind(); txtQueQuanXa.DataTextField = "NAME"; txtQueQuanXa.DataValueField = "ID"; txtQueQuanXa.DataBind(); txtQueQuanXa.Text = item.QueQuanXa; }