Ejemplo n.º 1
0
 public tbl_HoSoPV GetOneData(int id)
 {
     try
     {
         tbl_HoSoPV data = db.tbl_HoSoPV.Find(id);
         return(data);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(null);
     }
 }
Ejemplo n.º 2
0
 public tbl_HoSoPV AddData(tbl_HoSoPV data)
 {
     try
     {
         tbl_HoSoPV d = db.tbl_HoSoPV.Add(data);
         db.SaveChanges();
         return(d);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public int DeleteData(int id)
 {
     try
     {
         tbl_HoSoPV tb = db.tbl_HoSoPV.Find(id);
         db.tbl_HoSoPV.Remove(tb);
         db.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(-1);
     }
 }
Ejemplo n.º 4
0
 public int UpdateData(tbl_HoSoPV data)
 {
     try
     {
         var update = db.tbl_HoSoPV.Find(data.HoSoPVID);
         update.copy(data);
         db.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
         return(0);
     }
 }
Ejemplo n.º 5
0
 private void LoadData1(int id)
 {
     _id = id;
     _pv = HoSoPVBUS.Instance.GetOneData(id);
     if (_pv.KetQuaPV == null)
     {
         bsiSTT.Caption = "Chưa phỏng vấn";
     }
     else if (_pv.KetQuaPV == 1)
     {
         bsiSTT.Caption = "Được nhận";
     }
     else if (_pv.KetQuaPV == 2)
     {
         bsiSTT.Caption = "Bị từ chối";
     }
 }
Ejemplo n.º 6
0
 private void LoadData(int id)
 {
     _id                       = id;
     _pv                       = HoSoPVBUS.Instance.GetOneData(id);
     _hoSo                     = NhanVienBUS.Instance.GetOneData(_pv.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;
         }
     }
 }
Ejemplo n.º 7
0
 public int UpdateData(tbl_HoSoPV data)
 {
     return(HoSoPVDAO.Instance.UpdateData(data));
 }
Ejemplo n.º 8
0
 public tbl_HoSoPV AddData(tbl_HoSoPV data)
 {
     return(HoSoPVDAO.Instance.AddData(data));
 }
Ejemplo n.º 9
0
        private void SaveData()
        {
            if (cbbCM.Text == "" || cbbPhongBan.Text == "" || cbbTDHV.Text == "" || cbbViTri.Text == "" || txtBacLuong.Text == "" || txtDanToc.Text == "" || txtDiaChi.Text == "" || txtEmail.Text == "" || txtHoTen.Text == "" || txtMoTa.Text == "" || txtSDT.Text == "")
            {
                XtraMessageBox.Show("Không được bỏ trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (_id == -1)
            {
                int          phongBanID  = listPhongBan[cbbPhongBan.SelectedIndex].PhongBanID;
                int          chucVuID    = listChucVu[cbbViTri.SelectedIndex].ChucVuID;
                int          trinhdoID   = listTrinhDoHocVan[cbbTDHV.SelectedIndex].TrinhDoHocVanID;
                int          chuyenMonID = listChuyenMon[cbbCM.SelectedIndex].ChuyenMonID;
                tbl_NhanVien t           = new tbl_NhanVien();
                t.HoTen       = txtHoTen.Text;
                t.NgaySinh    = Convert.ToDateTime(dNgaySinh.Text);
                t.QueQuan     = txtDiaChi.Text;
                t.GioiTinh    = (radioGroup1.SelectedIndex == 0);
                t.DanToc      = txtDanToc.Text;
                t.SDT         = txtSDT.Text;
                t.Email       = txtEmail.Text;
                t.PhongBanID  = phongBanID;
                t.ChucVuID    = chucVuID;
                t.TDHVID      = trinhdoID;
                t.LuongYeuCau = txtBacLuong.Text;
                t.TrangThai   = 1;
                t.ChuyenMonID = chuyenMonID;
                _hoSo         = NhanVienBUS.Instance.AddData(t);

                tbl_HoSoPV h = new tbl_HoSoPV();
                h.NhanVienID = _hoSo.NhanVienID;
                h            = HoSoPVBUS.Instance.AddData(h);

                _hoSo.HoSoPVID = h.HoSoPVID;
                NhanVienBUS.Instance.UpdateData(_hoSo);
            }
            else
            {
                int          phongBanID  = listPhongBan[cbbPhongBan.SelectedIndex].PhongBanID;
                int          chucVuID    = listChucVu[cbbViTri.SelectedIndex].ChucVuID;
                int          trinhdoID   = listTrinhDoHocVan[cbbTDHV.SelectedIndex].TrinhDoHocVanID;
                int          chuyenMonID = listChuyenMon[cbbCM.SelectedIndex].ChuyenMonID;
                tbl_NhanVien t           = new tbl_NhanVien();
                t.NhanVienID  = _hoSo.NhanVienID;
                t.HoTen       = txtHoTen.Text;
                t.NgaySinh    = Convert.ToDateTime(dNgaySinh.Text);
                t.QueQuan     = txtDiaChi.Text;
                t.GioiTinh    = (radioGroup1.SelectedIndex == 0);
                t.DanToc      = txtDanToc.Text;
                t.SDT         = txtSDT.Text;
                t.Email       = txtEmail.Text;
                t.PhongBanID  = phongBanID;
                t.ChucVuID    = chucVuID;
                t.TDHVID      = trinhdoID;
                t.LuongYeuCau = txtBacLuong.Text;
                t.TrangThai   = 1;
                t.ChuyenMonID = chuyenMonID;
                t.HoSoPVID    = _hoSo.HoSoPVID;

                NhanVienBUS.Instance.UpdateData(t);
                _hoSo = t;
            }
            XtraMessageBox.Show("Lưu thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }