상속: IP.Core.IPUserService.US_Object
 private decimal get_id_nhan_vien_by_ma_nv(string ip_str_ma_nv)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();
     v_us.FillDataset(v_ds, "where ma_nv =" + ip_str_ma_nv);
     return decimal.Parse(v_ds.Tables[0].Rows[0][0].ToString());
 }
 public void display_for_phan_loai_lao_dong(string ip_str_op_filter, DateTime ip_dat_tai_ngay, decimal ip_dc_id_don_vi)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     m_grc.DataSource = v_us.RPT_lay_danh_sach_nhan_vien_theo_chuyen_mon(ip_str_op_filter, ip_dat_tai_ngay, ip_dc_id_don_vi);
     panelControl3.Visible = false;
     ShowDialog();
 }
        private decimal find_id_nhan_vien_by_ma_nv(string ip_str_ma_nv)
        {
            try
            {
                US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
                DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();

                v_us.FillDataset(v_ds);

                string v_str_filter = "MA_NV = '" + ip_str_ma_nv + "'";
                DataRow[] v_dr = v_ds.DM_NHAN_VIEN.Select(v_str_filter);

                if (v_dr.Count() == 0)
                {
                    return -1;
                }
                else
                {
                    return CIPConvert.ToDecimal(v_dr.First()["ID"].ToString());
                }
            }
            catch (Exception v_e)
            {
                throw v_e;
            }
        }
 public void DisplayForUpdate(US_DM_NHAN_VIEN v_us)
 {
     m_e_form_mode = DataEntryFormMode.UpdateDataState;
     Text = "F150 - Sửa thông tin nhân viên";
     layoutControlItem16.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
     m_us = v_us;
     us_to_form(v_us);
     this.ShowDialog();
 }
 private bool check_ma_nhan_vien_is_ok(DataRow dataRow)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     DS_DM_NHAN_VIEN v_ds_nhan_vien = new DS_DM_NHAN_VIEN();
     v_us.FillDataset(v_ds_nhan_vien, " where MA_NV= '" + dataRow["MA_NHAN_VIEN"].ToString() + "'");
     //v_usdc.FillDatasetWithQuery(v_ds_nhan_vien, "select * from DM_NHAN_VIEN where MA_NV=" + dataRow["MA_NV"].ToString());
     if (v_ds_nhan_vien.Tables[0].Rows.Count > 0)
         return true;
     else
     {
         return false;
     }
 }
        private void load_data_2_nhan_vien_info(decimal ip_id_nhan_vien)
        {
            US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN(ip_id_nhan_vien);

            m_dtp_ns_nv.Value = v_us.datNGAY_SINH;
            m_txt_cmt.Text = v_us.strSO_CMT;
            m_txt_mst.Text = v_us.strMA_SO_THUE_CA_NHAN;
            m_txt_dia_chi.Text = v_us.strDIA_CHI_THUONG_TRU;

            //v_us_dm_nhan_vien.datNGAY_SINH = m_dtp_ns_nv.Value;
            //v_us_dm_nhan_vien.strSO_CMT = m_txt_cmt.Text;
            //v_us_dm_nhan_vien.strMA_SO_THUE_CA_NHAN = m_txt_mst.Text;
            //v_us_dm_nhan_vien.strDIA_CHI_THUONG_TRU = m_txt_dia_chi.Text;
        }
 private void load_data_to_group_control(decimal ip_id_nhan_vien)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN(ip_id_nhan_vien);
     m_dat_ngay_sinh.Value = v_us.datNGAY_SINH;
     load_data_to_rdb_gioi_tinh(v_us);
     m_txt_dan_toc.Text = v_us.strDAN_TOC;
     m_txt_quoc_tich.Text = v_us.strQUOC_TICH;
     m_txt_so_chung_minh_thu.Text = v_us.strSO_CMT;
     m_dat_ngay_cap_cmt.Value = v_us.datNGAY_CAP;
     m_txt_noi_cap_cmt.Text = v_us.strNOI_CAP;
     m_txt_so_dien_thoai.Text = v_us.strSDT;
     m_txt_email.Text = v_us.strEMAIL;
     m_txt_dia_chi_dang_ky_ho_khau.Text = v_us.strDIA_CHI_THUONG_TRU;
     m_txt_dia_chi_lien_he.Text = v_us.strDIA_CHI_LIEN_LAC;
 }
 private void load_data_to_rdb_gioi_tinh(US_DM_NHAN_VIEN v_us_nv)
 {
     if (v_us_nv.strGIOI_TINH == "" || v_us_nv.strGIOI_TINH == "NULL")
     {
         m_rdb_gioi_tinh_nam.Checked = false;
         m_rdb_gioi_tinh_nu.Checked = false;
     }
     else if (v_us_nv.strGIOI_TINH == "Y")
     {
         m_rdb_gioi_tinh_nam.Checked = true;
         m_rdb_gioi_tinh_nu.Checked = false;
     }
     else
     {
         m_rdb_gioi_tinh_nam.Checked = false;
         m_rdb_gioi_tinh_nu.Checked = true;
     }
 }
 private bool check_ma_nhan_vien_ko_ton_tai()
 {
     List<string> v_lst_nv_ko_ton_tai = new List<string>();
     for (int i = 0; i < m_grv.RowCount; i++)
     {
         var v_dr = m_grv.GetDataRow(i);
         US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
         if (!v_us.IsExistNhanVienInDB(v_dr[0].ToString()))
             v_lst_nv_ko_ton_tai.Add(v_dr[0].ToString());
     }
     if (v_lst_nv_ko_ton_tai.Count == 0)
         return false;
     else
     {
         string v_str = "Mã nhân viên '" + string.Join(",", v_lst_nv_ko_ton_tai) + "' không tồn tại. \nVui lòng kiểm tra lại!";
         XtraMessageBox.Show(v_str, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return true;
     }
 }
 private bool check_du_lieu_hop_le()
 {
     if(m_grv1.RowCount > 0)
     { }
     else
     {
         XtraMessageBox.Show("Chưa có dữ liệu", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return false;
     }
     for (int i = 0; i < m_grv1.RowCount; i++)
     {
         var v_dr = m_grv1.GetDataRow(i);
         US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
         if (!v_us.IsExistNhanVienInDB(v_dr[0].ToString()))
         {
             string v_str = "Mã nhân viên '" + v_dr[0].ToString() + "' không tồn tại. Vui lòng kiểm tra lại!";
             XtraMessageBox.Show(v_str, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return false;
         }
         else if (!check_datetime_data(v_dr[4].ToString()))
         {
             string v_str = "Vui lòng kiểm tra lại ngày sinh người phụ thuộc của nhân viên " + v_dr[0].ToString();
             XtraMessageBox.Show(v_str, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return false;
         }
         else if (!check_datetime_data(v_dr[15].ToString()))
         {
             string v_str = "Vui lòng kiểm tra lại tháng bắt đầu giảm trừ của nhân viên " + v_dr[0].ToString();
             XtraMessageBox.Show(v_str, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return false;
         }
         else if (!check_datetime_data(v_dr[16].ToString()))
         {
             string v_str = "Vui lòng kiểm tra lại tháng kết thúc giảm trừ của nhân viên " + v_dr[0].ToString();
             XtraMessageBox.Show(v_str, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return false;
         }
     }
     return true;
 }
 private decimal get_id_nv_by_ma_nv(string ip_str_ma_nv)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     return v_us.getIDNhanVienByMaNV(ip_str_ma_nv);
 }
 void f327_lap_hop_dong_v3_Load(object sender, EventArgs e)
 {
     try
     {
         US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
         m_dt_row = v_us.GetThongTinTGD();
         load_data_to_grid();
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
 private void load_data_to_grid(decimal ip_dc_id_nhan_vien)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();
     v_ds.Clear();
     v_us.FillDataset(v_ds, "WHERE ID = " + ip_dc_id_nhan_vien);
     m_grc.DataSource = v_ds.Tables[0];
 }
        private US_DM_NHAN_VIEN gan_du_lieu_cho_us_dm_nhan_vien(DataRow dataRow)
        {
            US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
            if(m_e_form_mode == DataEntryFormMode.UpdateDataState) v_us = new US_DM_NHAN_VIEN(ExecuteFuntion.LayNhanVienID(dataRow["MA_NV"].ToString()));
            
            if (dataRow["NGAY_CAP"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_CAP"].ToString()))
                v_us.datNGAY_CAP = WinFormControls.FormatPostingDate(dataRow["NGAY_CAP"].ToString());

            if (dataRow["NGAY_CAP_THE"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_CAP_THE"].ToString()))
                v_us.datNGAY_CAP_THE = WinFormControls.FormatPostingDate(dataRow["NGAY_CAP_THE"].ToString());

            if (dataRow["NGAY_CHINH_THUC_TIEP_NHAN"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_CHINH_THUC_TIEP_NHAN"].ToString()))
                v_us.datNGAY_CHINH_THUC_TIEP_NHAN = WinFormControls.FormatPostingDate(dataRow["NGAY_CHINH_THUC_TIEP_NHAN"].ToString());

            if (dataRow["NGAY_HET_HAN_THE"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_HET_HAN_THE"].ToString()))
                v_us.datNGAY_HET_HAN_THE = WinFormControls.FormatPostingDate(dataRow["NGAY_HET_HAN_THE"].ToString());

            if (dataRow["NGAY_SINH"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_SINH"].ToString()))
                v_us.datNGAY_SINH = WinFormControls.FormatPostingDate(dataRow["NGAY_SINH"].ToString());

            if (dataRow["NGAY_TIEP_NHAN_VAO_TCT"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_TIEP_NHAN_VAO_TCT"].ToString()))
                v_us.datNGAY_TIEP_NHAN_VAO_TCT = WinFormControls.FormatPostingDate(dataRow["NGAY_TIEP_NHAN_VAO_TCT"].ToString());

            if (dataRow["NGAY_VAO_HANG_KHONG"] != DBNull.Value || !string.IsNullOrEmpty(dataRow["NGAY_VAO_HANG_KHONG"].ToString()))
                v_us.datNGAY_VAO_HANG_KHONG = Convert.ToDateTime(dataRow["NGAY_VAO_HANG_KHONG"]);

            v_us.strCHUYEN_MON = dataRow["CHUYEN_MON"].ToString();
            v_us.strDAN_TOC = dataRow["DAN_TOC"].ToString();
            v_us.strDIA_CHI_LIEN_LAC = dataRow["DIA_CHI_LIEN_LAC"].ToString();
            v_us.strDIA_CHI_TAM_TRU = dataRow["DIA_CHI_TAM_TRU"].ToString();
            v_us.strDIA_CHI_THUONG_TRU = dataRow["DIA_CHI_THUONG_TRU"].ToString();
            v_us.strEMAIL = dataRow["EMAIL"].ToString();
            //v_us.strGIOI_TINH = dataRow["GIOI_TINH"].ToString();
            if (dataRow["GIOI_TINH"].ToString().Trim().ToUpper() == "NAM")
                v_us.strGIOI_TINH = "Y";
            else v_us.strGIOI_TINH = "N";
            v_us.strHO_DEM = dataRow["HO_DEM"].ToString();
            v_us.strHON_NHAN = dataRow["HON_NHAN"].ToString();
            v_us.strMA_NV = dataRow["MA_NV"].ToString();
            v_us.strMA_SO_THUE_CA_NHAN = dataRow["MA_SO_THUE_CA_NHAN"].ToString();
            v_us.strNAM_TOT_NGHIEP = dataRow["NAM_TOT_NGHIEP"].ToString();
            v_us.strNGAN_HANG = dataRow["NGAN_HANG"].ToString();
            v_us.strNOI_CAP = dataRow["NOI_CAP"].ToString();
            v_us.strNOI_SINH = dataRow["NOI_SINH"].ToString();
            v_us.strQUE_QUAN = dataRow["QUE_QUAN"].ToString();
            v_us.strQUOC_TICH = dataRow["QUOC_TICH"].ToString();
            v_us.strSDT = dataRow["SDT"].ToString();
            v_us.strSO_CMT = dataRow["SO_CMT"].ToString();
            v_us.strSO_TAI_KHOAN = dataRow["SO_TAI_KHOAN"].ToString();
            v_us.strTEN = dataRow["TEN"].ToString();
            v_us.strTON_GIAO = dataRow["TON_GIAO"].ToString();
            v_us.strTOT_NGHIEP_TAI = dataRow["TOT_NGHIEP_TAI"].ToString();
            v_us.strTRINH_DO_VAN_HOA = find_id_cm_dm_tu_dien_by_trinh_do_van_hoa(dataRow["TRINH_DO_VAN_HOA"].ToString().Trim());
            v_us.strNGUOI_BAO_LANH = dataRow["NGUOI_BAO_LANH"].ToString();
            
            return v_us;
        }
        private decimal find_id_nv_by_ma_nv(string v)
        {
            try
            {
                US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
                DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();
                v_us.FillDataset(v_ds, "WHERE MA_NV = " + v);
                string v_str_filter = "MA_NV = " + v;
                DataRow[] v_dr = v_ds.DM_NHAN_VIEN.Select(v_str_filter);

                if(v_dr.Count() == 0)
                {
                    return -1;
                }
                else
                {
                    return CIPConvert.ToDecimal(v_dr.First()["ID"].ToString());
                }
            }
            catch(Exception)
            {
                throw new Exception("Chưa có nhân viên. Vui lòng nhập nhân viên trước");
            }
        }
        private void save_data()
        {
            US_DM_NHAN_VIEN v_us_trans = new US_DM_NHAN_VIEN();
            int i = 0;
            try
            {
                
                SplashScreenManager.ShowForm(typeof(F_wait_form));
                
                v_us_trans.BeginTransaction();
                for (i = 0; i < m_grv.RowCount; i++)
                {
                    US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
                    switch (m_e_form_mode)
                    {
                        case DataEntryFormMode.UpdateDataState:
                            v_us = gan_du_lieu_cho_us_dm_nhan_vien(m_grv.GetDataRow(i));
                            v_us.UseTransOfUSObject(v_us_trans);
                            v_us.Update();
                            break;
                        case DataEntryFormMode.InsertDataState:
                            v_us = gan_du_lieu_cho_us_dm_nhan_vien(m_grv.GetDataRow(i));
                            v_us.Insert();
                            break;
                        default:
                            break;
                    }
                }
                v_us_trans.CommitTransaction();
                m_lbl_check.Text = "Đã lưu dữ liệu";
                m_lbl_check.ForeColor = Color.Green;
                CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_LUU_DU_LIEU_THANH_CONG);

            }
            catch (Exception v_e)
            {
                XtraMessageBox.Show(i.ToString());
                if (v_us_trans.is_having_transaction())
                {
                    v_us_trans.Rollback();
                }
                throw;
            }
            finally
            {
                SplashScreenManager.CloseForm();
            }

        }
        private void us_to_form(US_DM_NHAN_VIEN v_us)
        {
            m_txt_ma_nv.Text = m_us.strMA_NV;
            m_txt_ho_dem_nv.Text = m_us.strHO_DEM;
            m_txt_ten_nv.Text = m_us.strTEN;
            m_txt_email.Text = m_us.strEMAIL;
            m_txt_sdt.Text = m_us.strSDT;
            m_txt_so_tai_khoan.Text = m_us.strSO_TAI_KHOAN;
            m_txt_ngan_hang.Text = m_us.strNGAN_HANG;
            if (m_us.strGIOI_TINH == "Y")
                m_cbo_gioi_tinh.Text = "Nam";
            else
                m_cbo_gioi_tinh.Text = "Nữ";
            if (m_us.datNGAY_CAP_THE != new DateTime(1900, 01, 01))
                m_dat_ngay_cap_the.EditValue = m_us.datNGAY_CAP_THE;
            if (m_us.datNGAY_HET_HAN_THE != new DateTime(1900, 01, 01))
                m_dat_ngay_het_han_the.EditValue = m_us.datNGAY_HET_HAN_THE;
            if (m_us.datNGAY_SINH != new DateTime(1900, 01, 01))
                m_dat_ngay_sinh.EditValue = m_us.datNGAY_SINH;

            m_sle_trinh_do.Text = m_us.strTRINH_DO_VAN_HOA;
            m_txt_so_cmt.Text = m_us.strSO_CMT;
            if (m_us.datNGAY_CAP == DateTime.MinValue)
                m_dat_ngay_cap_cmt.EditValue = m_us.datNGAY_CAP;
            m_txt_noi_cap_cmt.Text = m_us.strNOI_CAP;
            m_txt_quoc_tich.Text = m_us.strQUOC_TICH;
            m_txt_dan_toc.Text = m_us.strDAN_TOC;
            m_txt_ton_giao.Text = m_us.strTON_GIAO;
            m_txt_noi_sinh.Text = m_us.strNOI_SINH;
            m_txt_que_quan.Text = m_us.strQUE_QUAN;
            m_txt_dia_chi_thuong_tru.Text = m_us.strDIA_CHI_THUONG_TRU;
            m_txt_dia_chi_tam_tru.Text = m_us.strDIA_CHI_TAM_TRU;
            m_txt_dia_chi_lien_lac.Text = m_us.strDIA_CHI_LIEN_LAC;
            m_txt_ma_so_thue_ca_nhan.Text = m_us.strMA_SO_THUE_CA_NHAN;
            m_txt_chuyen_mon.Text = m_us.strCHUYEN_MON;
            // m_txt_trinh_do_van_hoa.Text=             //  m_us.strTRINH_DO_VAN_HOA ;
            m_txt_nam_tot_nghiep.Text = m_us.strNAM_TOT_NGHIEP;
            m_cbc_hon_nhan.Text = m_us.strHON_NHAN;
            m_txt_noi_tot_nghiep.Text = m_us.strTOT_NGHIEP_TAI;
            if (m_us.datNGAY_VAO_HANG_KHONG.Date != new DateTime(1900, 01, 01))
                m_dat_ngay_vao_hang_khong.EditValue = m_us.datNGAY_VAO_HANG_KHONG;
            if (m_us.datNGAY_TIEP_NHAN_VAO_TCT != new DateTime(1900, 01, 01))
                m_dat_ngay_tiep_nhan_vao_tct.EditValue = m_us.datNGAY_TIEP_NHAN_VAO_TCT;
            if (m_us.datNGAY_CHINH_THUC_TIEP_NHAN != new DateTime(1900, 01, 01))
                m_dat_ngay_chinh_thuc_tiep_nhan.EditValue = m_us.datNGAY_CHINH_THUC_TIEP_NHAN;
        }
        //load data to all controls
        private void load_data_2_sle_nhan_vien()
        {
            US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
            DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();
            m_sle_chon_nhan_vien.Properties.DataSource = v_us.LayDanhSachNhanVien();
            m_sle_chon_nhan_vien.Properties.DisplayMember = V_DM_NHAN_VIEN.HO_TEN;
            m_sle_chon_nhan_vien.Properties.ValueMember = V_DM_NHAN_VIEN.ID;

               // m_sle_chon_nhan_vien.Properties.DataSource = v_ds.Tables[0];
            m_sle_chon_nhan_vien.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            m_sle_chon_nhan_vien.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFit;
        }
 private decimal get_id_by_ma_nhan_vien(string ip_str_ma_nv)
 {
     DS_DM_NHAN_VIEN v_ds = new DS_DM_NHAN_VIEN();
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     v_us.FillDataset(v_ds);
     decimal v_id_nv = v_us.getIDNhanVienByMaNV(ip_str_ma_nv);
     //decimal v_id_nv =  CIPConvert.ToDecimal( v_ds.Tables[0].Rows[0][0].ToString());
     if (!m_lst_nv_insert_phu_thuoc.Contains(v_id_nv))
     {
         m_lst_nv_insert_phu_thuoc.Add(v_id_nv);
     }
     return v_id_nv;
 }
 private void delete_click()
 {
     //XtraMessageBox.Show(i_strMsg, "XÁC NHẬN LẠI", MessageBoxButtons.YesNo, MessageBoxIcon.Error)
     DialogResult v_confirm = default(DialogResult);
     v_confirm = XtraMessageBox.Show("BẠN CÓ THỰC SỰ MUỐN XÓA DỮ LIỆU NÀY ?", "XÁC NHẬN LẠI", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
     if(v_confirm == DialogResult.Yes)
     {
         DataRow v_dr = m_grv.GetDataRow(m_grv.FocusedRowHandle);
         US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN(CIPConvert.ToDecimal(v_dr["ID"].ToString()));
         v_us.Delete();
         load_data_to_grid();
         CHRM_BaseMessages.MsgBox_Infor("Xóa dữ liệu thành công");
     }
 }
 private void load_data_to_grid()
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     m_grc_main.DataSource = v_us.LayDanhSachMaTraCuu(get_id_don_vi(), get_id_chuc_vu());
     m_grc.DataSource = v_us.LayDanhSachMaTraCuu(get_id_don_vi(), get_id_chuc_vu());
 }
 private void load_data_to_grid()
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     v_us.LayDanhSachNhanVien();
     m_grc.DataSource = v_us.LayDanhSachNhanVien();
 }
 private bool check_ma_nhan_vien_ton_tai(DataRow ip_dr)
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     var is_exist = v_us.IsExistNhanVienInDB(ip_dr[ExcelLNS.MA_NHAN_VIEN].ToString());
     if(!is_exist)
     {
         XtraMessageBox.Show("Mã nhân viên " + ip_dr[ExcelLNS.MA_NHAN_VIEN].ToString() + " chưa tồn tại trong hệ thống!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     return is_exist;
 }
 private bool is_exist_nv_in_db()
 {
     US_DM_NHAN_VIEN v_us_dm_nv = new US_DM_NHAN_VIEN();
     return v_us_dm_nv.IsExistNhanVienInDB(m_ma_nv);
 }
 private DataTable load_data_to_ma_nv()
 {
     US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
     DS_DM_NHAN_VIEN v_ds_nhan_vien = new DS_DM_NHAN_VIEN();
     v_us.FillDataset(v_ds_nhan_vien);
     return v_ds_nhan_vien.Tables[0];
 }
        private void insert_hs_hs_bs_hs_anhk(decimal ip_dc_thang, decimal ip_dc_nam)
        {
            US_DM_NHAN_VIEN v_us_dung_chung = new US_DM_NHAN_VIEN();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us_dung_chung.FillDatasetNhanVienCanInsertHeSo(v_ds, ip_dc_thang, ip_dc_nam);
            //v_us_dung_chung.FillDatasetWithQuery(v_ds, "SELECT DISTINCT * FROM V_RPT_LUONG WHERE THANG = " + m_txt_thang.Text.Trim() + " AND NAM = " + m_txt_nam.Text.Trim());

            //m_grc.DataSource = v_ds.Tables[0];

            for(int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
            {
                decimal v_id_nv = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[i]["ID_NHAN_VIEN"].ToString());
                US_GD_HS_BO_SUNG_AN_TOAN_HANG_KHONG v_us = new US_GD_HS_BO_SUNG_AN_TOAN_HANG_KHONG();

                v_us.insert_data_by_proc(v_id_nv, ip_dc_thang, ip_dc_nam);
            }
            DevExpress.XtraEditors.XtraMessageBox.Show("Thành công!!!", "THÔNG BÁO");
            load_data_2_grid();
        }
        private bool check_ma_nhan_vien_is_ok(DataRow dataRow)
        {
            //US_DUNG_CHUNG v_usdc = new US_DUNG_CHUNG();
            //DataSet v_ds_nhan_vien = new DataSet();
            //v_ds_nhan_vien.Tables.Add(new DataTable());
            if (dataRow["MA_NV"] == null || dataRow["MA_NV"].ToString() == "")
            {
                XtraMessageBox.Show("Có ô mã nhân viên bị trống!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
            DS_DM_NHAN_VIEN v_ds_nhan_vien = new DS_DM_NHAN_VIEN();
            v_us.FillDataset(v_ds_nhan_vien, " where MA_NV= '" + dataRow["MA_NV"].ToString() + "'");
            //v_usdc.FillDatasetWithQuery(v_ds_nhan_vien, "select * from DM_NHAN_VIEN where MA_NV=" + dataRow["MA_NV"].ToString());
            if (v_ds_nhan_vien.Tables[0].Rows.Count > 0)
            {
                CHRM_BaseMessages.MsgBox_Error("Mã nhân viên " + dataRow["MA_NV"].ToString() + "  đã tồn tại. Vui lòng kiểm tra lại thông tin!");
                return false;
            }

            else
            {
                return true;
            }
        }
 private void m_cmd_sua_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow v_dr = m_grv.GetDataRow(m_grv.FocusedRowHandle);
         US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN(CIPConvert.ToDecimal(v_dr["ID"].ToString()));
         f150_danh_muc_nhan_su_v2 v_f = new f150_danh_muc_nhan_su_v2();
         v_f.DisplayForUpdate(v_us);
         load_data_to_grid();
         focus_row(CIPConvert.ToDecimal(v_dr["ID"].ToString()));
     }
     catch(Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
        private bool check_ma_nhan_vien_update_is_ok(DataRow dataRow)
        {
            if (dataRow["MA_NV"] == null || dataRow["MA_NV"].ToString() == "")
            {
                XtraMessageBox.Show("Có ô mã nhân viên bị trống!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            US_DM_NHAN_VIEN v_us = new US_DM_NHAN_VIEN();
            DS_DM_NHAN_VIEN v_ds_nhan_vien = new DS_DM_NHAN_VIEN();
            v_us.FillDataset(v_ds_nhan_vien, " where MA_NV= '" + dataRow["MA_NV"].ToString() + "'");
            if (!(v_ds_nhan_vien.Tables[0].Rows.Count > 0))
            {
                CHRM_BaseMessages.MsgBox_Error("Mã nhân viên " + dataRow["MA_NV"].ToString() + "  chưa tồn tại. Vui lòng kiểm tra lại thông tin!");
                return false;
            }

            else
            {
                return true;
            }
        }
 private void load_data_2_grid()
 {
     US_DM_NHAN_VIEN v_us_nv = new US_DM_NHAN_VIEN();
     DS_V_GD_CONG_TAC v_ds_source = v_us_nv.XemQuaTrinhCongTac(m_ma_nv);
     m_grc_main.DataSource = v_ds_source.Tables[0];
 }