Exemple #1
0
 private void Init()
 {
     _tv            = ThuViecBUS.Instance.GetOneData(_id);
     _hs            = NhanVienBUS.Instance.GetOneData(_tv.ThuViecID);
     txtTen.Caption = _hs.HoTen;
     bbiGT.Caption  = (_hs.GioiTinh ?? default(bool)) ? "Nam" : "Nữ";
 }
Exemple #2
0
 public tbl_ThuViec GetOneData(int id)
 {
     try
     {
         tbl_ThuViec data = db.tbl_ThuViec.Find(id);
         return(data);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(null);
     }
 }
Exemple #3
0
 public tbl_ThuViec AddData(tbl_ThuViec data)
 {
     try
     {
         tbl_ThuViec d = db.tbl_ThuViec.Add(data);
         db.SaveChanges();
         return(d);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(null);
     }
 }
Exemple #4
0
 public int UpdateData(tbl_ThuViec data)
 {
     try
     {
         var update = db.tbl_ThuViec.Find(data.ThuViecID);
         update.copy(data);
         db.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(0);
     }
 }
Exemple #5
0
 public int DeleteData(int id)
 {
     try
     {
         tbl_ThuViec tb = db.tbl_ThuViec.Find(id);
         db.tbl_ThuViec.Remove(tb);
         db.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(-1);
     }
 }
Exemple #6
0
 public tbl_ThuViec GetOneDataByNVID(int id)
 {
     try
     {
         tbl_ThuViec data = db.tbl_ThuViec.Find(new tbl_ThuViec()
         {
             NhanVienID = id
         });
         return(data);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(null);
     }
 }
Exemple #7
0
 private void LoadData(int id)
 {
     _id                       = id;
     _tv                       = ThuViecBUS.Instance.GetOneData(id);
     _hoSo                     = NhanVienBUS.Instance.GetOneData(_tv.NhanVienID ?? default(int));
     txtHoTen.Text             = _hoSo.HoTen;
     dNgaySinh.EditValue       = _hoSo.NgaySinh;
     txtBacLuong.Text          = _hoSo.LuongYeuCau;
     txtDanToc.Text            = _hoSo.DanToc;
     txtDiaChi.Text            = _hoSo.DanToc;
     txtEmail.Text             = _hoSo.Email;
     txtMoTa.Text              = _hoSo.Mota;
     txtSDT.Text               = _hoSo.SDT;
     radioGroup1.SelectedIndex = _hoSo.GioiTinh ?? default(bool) ? 0 : 1;
     for (int i = 0; i < listChuyenMon.Count; ++i)
     {
         if (listChuyenMon[i].ChuyenMonID == _hoSo.ChuyenMonID)
         {
             cbbCM.SelectedIndex = i;
         }
     }
     for (int i = 0; i < listPhongBan.Count; ++i)
     {
         if (listPhongBan[i].PhongBanID == _hoSo.PhongBanID)
         {
             cbbPhongBan.SelectedIndex = i;
         }
     }
     for (int i = 0; i < listChucVu.Count; ++i)
     {
         if (listChucVu[i].ChucVuID == _hoSo.ChucVuID)
         {
             cbbViTri.SelectedIndex = i;
         }
     }
     for (int i = 0; i < listTrinhDoHocVan.Count; ++i)
     {
         if (listTrinhDoHocVan[i].TrinhDoHocVanID == _hoSo.TDHVID)
         {
             cbbTDHV.SelectedIndex = i;
         }
     }
 }
Exemple #8
0
 private void SaveData()
 {
     if (_pv.KetQuaPV == 1)
     {
         _hoSo.TrangThai = 3;
         tbl_ThuViec _tv = new tbl_ThuViec();
         _tv = ThuViecBUS.Instance.GetOneDataByNVID(_hoSo.NhanVienID);
         if (_tv == null)
         {
             _tv            = new tbl_ThuViec();
             _tv.NhanVienID = _hoSo.NhanVienID;
             ThuViecBUS.Instance.AddData(_tv);
         }
     }
     else if (_pv.KetQuaPV == 2)
     {
         _hoSo.TrangThai = -1;
     }
     NhanVienBUS.Instance.UpdateData(_hoSo);
     HoSoPVBUS.Instance.UpdateData(_pv);
     XtraMessageBox.Show("Lưu thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     LoadData1(_pv.HoSoPVID);
 }
        private void Init()
        {
            listPhongBan = PhongBanBUS.Instance.GetAllData();
            foreach (var t in listPhongBan)
            {
                cbbPhongBan.Properties.Items.Add(t.TenPhongBan);
            }
            listChucVu = ChucVuBUS.Instance.GetAllData();
            foreach (var t in listChucVu)
            {
                cbbViTri.Properties.Items.Add(t.TenChucVu);
            }
            listTrinhDoHocVan = TrinhDoHocVanBUS.Instance.GetAllData();
            foreach (var t in listTrinhDoHocVan)
            {
                cbbTDHV.Properties.Items.Add(t.TenTrinhDoHocVan);
            }
            listChuyenMon = ChuyenMonBUS.Instance.GetAllData();
            foreach (var t in listChuyenMon)
            {
                cbbCM.Properties.Items.Add(t.TenChuyenMon);
            }

            _tv   = ThuViecBUS.Instance.GetOneData(_id);
            _hoSo = NhanVienBUS.Instance.GetOneData(_tv.NhanVienID ?? default(int));

            txtHoTen.Text             = _hoSo.HoTen;
            dNgaySinh.EditValue       = _hoSo.NgaySinh;
            txtBacLuong.Text          = _hoSo.LuongYeuCau;
            txtDanToc.Text            = _hoSo.DanToc;
            txtDiaChi.Text            = _hoSo.DanToc;
            txtEmail.Text             = _hoSo.Email;
            txtSDT.Text               = _hoSo.SDT;
            radioGroup1.SelectedIndex = _hoSo.GioiTinh ?? default(bool) ? 0 : 1;
            for (int i = 0; i < listChuyenMon.Count; ++i)
            {
                if (listChuyenMon[i].ChuyenMonID == _hoSo.ChuyenMonID)
                {
                    cbbCM.SelectedIndex = i;
                }
            }
            for (int i = 0; i < listPhongBan.Count; ++i)
            {
                if (listPhongBan[i].PhongBanID == _hoSo.PhongBanID)
                {
                    cbbPhongBan.SelectedIndex = i;
                }
            }
            for (int i = 0; i < listChucVu.Count; ++i)
            {
                if (listChucVu[i].ChucVuID == _hoSo.ChucVuID)
                {
                    cbbViTri.SelectedIndex = i;
                }
            }
            for (int i = 0; i < listTrinhDoHocVan.Count; ++i)
            {
                if (listTrinhDoHocVan[i].TrinhDoHocVanID == _hoSo.TDHVID)
                {
                    cbbTDHV.SelectedIndex = i;
                }
            }
        }
Exemple #10
0
 public int UpdateData(tbl_ThuViec data)
 {
     return(ThuViecDAO.Instance.UpdateData(data));
 }
Exemple #11
0
 public tbl_ThuViec AddData(tbl_ThuViec data)
 {
     return(ThuViecDAO.Instance.AddData(data));
 }