Inheritance: IP.Core.IPUserService.US_Object
 private void load_data_to_sle_ten_nhan_vien()
 {
     DataSet v_ds = new DataSet();
     DataTable v_dt = new DataTable();
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     v_ds.Tables.Add(v_dt);
     throw new Exception("Sua lai khong dung FillDataSetWithTableName nua nhe");
        // v_us.FillDatasetWithTableName(v_ds, "V_DM_NHAN_VIEN");
     m_sle_ten_nhan_vien.Properties.DataSource = v_ds.Tables[0];
     m_sle_ten_nhan_vien.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
 }
 private void delete_gd_da_co_trong_thang_cua_nhan_vien(US_DUNG_CHUNG v_us_dc, DataRow v_data_row, decimal ip_dc_id_nv)
 {
     decimal v_id_gd_hs_chat_luong = 0;
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us_dc.FillDatasetWithQuery(v_ds, "SELECT * FROM GD_HE_SO_CHAT_LUONG WHERE ID_NHAN_VIEN =" + ip_dc_id_nv + " AND THANG = " + CIPConvert.ToDecimal(m_txt_chon_thang.Text.Trim()) + " AND NAM = " + CIPConvert.ToDecimal(m_txt_chon_nam.Text.Trim()));
     if (v_ds.Tables[0].Rows.Count > 0)
     {
         v_id_gd_hs_chat_luong = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0]["ID"].ToString());
         US_GD_HE_SO_CHAT_LUONG v_us_gd_hs_cl = new US_GD_HE_SO_CHAT_LUONG(v_id_gd_hs_chat_luong);
         v_us_gd_hs_cl.BeginTransaction();
         v_us_gd_hs_cl.Delete();
         v_us_gd_hs_cl.CommitTransaction();
     }
     else
     {
         return;
     }
 }
 private bool check_ngay_cong_phep(System.Data.DataRow v_dr)
 {
     if (v_dr["MA_NGAY_CONG"].ToString() == "F")
     {
         DataSet v_ds = new DataSet();
         US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
         v_ds.Tables.Add(new DataTable());
         string v_nam_cham_cong = m_dat_ngay_cham_cong.Value.Year.ToString();
         decimal v_id_nhan_vien = CIPConvert.ToDecimal(v_dr["ID_NHAN_VIEN"].ToString());
         v_us.FillDatasetNgayPhepTieuChuan(v_ds, v_nam_cham_cong , v_id_nhan_vien);
         decimal v_so_phep_da_nghi = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0]["SO_PHEP_DA_NGHI"].ToString());
         decimal v_so_phep_tieu_chuan = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0]["SO_PHEP_TIEU_CHUAN"].ToString());
         if (v_so_phep_da_nghi == v_so_phep_tieu_chuan)
         {
             return false;
         }
         else return true;
     }
     else return true;
 }
        private void load_data_2_gridd(decimal ip_dc_thang, decimal ip_dc_nam)
        {
            CHRMCommon.make_stt(m_grv_quan_ly_thu_nhap_khac);
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());

            v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM V_GD_THU_NHAP_KHAC WHERE THANG = " + ip_dc_thang + " AND NAM = " + ip_dc_nam);

            m_grc_quan_ly_thu_nhap_khac.DataSource = v_ds.Tables[0];
        }
        private void load_data_2_grid(decimal ip_dc_thang, decimal ip_dc_nam)
        {
            CHRMCommon.make_stt(m_grv_hs_chat_luong);
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());

            //v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM V_GD_HE_SO_CHAT_LUONG WHERE THANG = " + ip_dc_thang + " AND NAM = " + ip_dc_nam);
            m_grc_hs_chat_luong.DataSource = v_ds.Tables[0];
        }
        private DataSet load_data_2_ds_v_dm_nv()
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithTableName(v_ds, "V_DM_NHAN_VIEN");
            return v_ds;
        }
 private void load_data_2_grid()
 {
     int v_row_count = 0;
     CHRMCommon.make_stt(m_grv_cham_cong);
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new System.Data.DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetGDChamCong(v_ds, m_dat_ngay_cham_cong.Value.Date);
     v_row_count = v_ds.Tables[0].Rows.Count;
     m_grc_cham_cong.DataSource = v_ds.Tables[0];
 }
        private DataSet load_data_2_ds_dm_loai_ngay_cong(DataSet v_ds_dm_loai_ngay_cong)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds_ = new DataSet();
            v_ds_dm_loai_ngay_cong.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds_dm_loai_ngay_cong, "select ID AS ID_LOAI_NGAY_CONG, MA_NGAY_CONG, TEN_NGAY_CONG FROM DM_LOAI_NGAY_CONG");

            return v_ds_dm_loai_ngay_cong;
        }
 private void LayDuLieuLoaiNgayCong()
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     m_ds_loai_ngay_cong.Tables.Add(new DataTable());
     m_ds_loai_ngay_cong.Clear();
     v_us.FillDatasetCBO(m_ds_loai_ngay_cong, "DM_LOAI_NGAY_CONG", "ID", "MA_NGAY_CONG", "");
 }
        private void kiem_tra_va_thuc_hien_nhap_hs(ref decimal v_count, ref int v_int_khong_nhap_duoc, decimal v_selectedRowCount)
        {
            if (CHRMCommon.thang_da_chot_bang_luong(CIPConvert.ToDecimal(m_txt_chon_thang.Text.Trim()), CIPConvert.ToDecimal(m_txt_chon_nam.Text.Trim())))
            {
                CHRM_BaseMessages.MsgBox_Error(CONST_ID_MSGBOX.ERROR_THANG_DA_CHOT_BANG_LUONG);
                return;
            }
            else
            {
                for (int i = 0; i < v_selectedRowCount; i++)
                {
                    decimal v_id_nv = 0;
                    US_DUNG_CHUNG v_us_dc = new US_DUNG_CHUNG();
                    US_GD_HE_SO_CHAT_LUONG v_us_hs_cl = new US_GD_HE_SO_CHAT_LUONG();

                    var v_data_row = m_grv_them_hs.GetDataRow(m_grv_them_hs.GetSelectedRows()[i]);

                    try
                    {
                        get_id_nhan_vien_tu_data_row(v_us_dc, v_data_row, ref v_id_nv);
                    }
                    catch (Exception)
                    {
                        CHRM_BaseMessages.MsgBox_Error("Mã nhân viên " + v_data_row[1].ToString() + " không tồn tại trong hệ thống. Vui lòng kiểm tra lại thông tin!");
                        v_int_khong_nhap_duoc++;
                        continue;
                    }

                    v_us_hs_cl.dcID_NHAN_VIEN = v_id_nv;
                    v_us_hs_cl.dcHE_SO_K = Convert.ToDecimal(v_data_row["HSK"]);
                    v_us_hs_cl.dcTHANG = CIPConvert.ToDecimal(m_txt_chon_thang.Text.Trim());
                    v_us_hs_cl.dcNAM = CIPConvert.ToDecimal(m_txt_chon_nam.Text.Trim());
                    v_us_hs_cl.datNGAY_LAP = DateTime.Now.Date;
                    v_us_hs_cl.strNGUOI_LAP = CAppContext_201.getCurrentUserName();
                    v_us_hs_cl.strDA_XOA = "N";

                    try
                    {
                        delete_gd_da_co_trong_thang_cua_nhan_vien(v_us_dc, v_data_row, v_id_nv);
                        v_us_hs_cl.BeginTransaction();
                        v_us_hs_cl.Insert();
                        v_us_hs_cl.CommitTransaction();
                        v_count++;
                    }
                    catch (Exception)
                    {
                        CHRM_BaseMessages.MsgBox_Error(CONST_ID_MSGBOX.ERROR_DA_CO_LOI_XAY_RA);
                        v_int_khong_nhap_duoc++;
                    }
                }
            }
        }
 private void get_id_nhan_vien_tu_data_row(US_DUNG_CHUNG v_us_dc, DataRow v_data_row, ref decimal v_id_nv)
 {
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us_dc.FillDatasetWithQuery(v_ds, "SELECT * FROM DM_NHAN_VIEN WHERE MA_NV ='" + v_data_row[1].ToString() + "'");
     v_id_nv = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0]["ID"].ToString());
 }
        private void tao_file_mau()
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.get_bang_cham_cong(v_ds, m_txt_chon_thang.Text, m_txt_chon_nam.Text);

            var v_c_hsk = new DataColumn();
            v_c_hsk.ColumnName = "HSK";
            v_ds.Tables[0].Columns.Add(v_c_hsk);
            m_grc_them_hs.DataSource = v_ds.Tables[0];
            SaveXLSX();
        }
        private DataSet load_data_2_ds_v_dm_nv()
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            throw new Exception("Sua lai khong dung FillDataSetWithTableName nua nhe");
            //v_us.FillDatasetWithTableName(v_ds, "V_DM_NHAN_VIEN");
            return v_ds;
        }