private bool check_ct_dang_su_dung(decimal ip_id_chuc_vu)
 {
     US_GD_CONG_TAC v_us_ct = new US_GD_CONG_TAC();
     DS_GD_CONG_TAC v_ds_ct = new DS_GD_CONG_TAC();
     v_us_ct.FillDataset(v_ds_ct, "where id_vi_tri = " + ip_id_chuc_vu);
     if (v_ds_ct.Tables[0].Rows.Count == 0)
     {
         return false;
     }
     else return true;
 }
 public US_GD_CONG_TAC(decimal i_dbID)
 {
     pm_objDS = new DS_GD_CONG_TAC();
     pm_strTableName = c_TableName;
     IMakeSelectCmd v_objMkCmd = new CMakeAndSelectCmd(pm_objDS, c_TableName);
     v_objMkCmd.AddCondition("ID", i_dbID, eKieuDuLieu.KieuNumber, eKieuSoSanh.Bang);
     SqlCommand v_cmdSQL;
     v_cmdSQL = v_objMkCmd.getSelectCmd();
     this.FillDatasetByCommand(pm_objDS, v_cmdSQL);
     pm_objDR = getRowClone(pm_objDS.Tables[pm_strTableName].Rows[0]);
 }
 private DataRow get_don_vi_hien_tai(decimal v_id_nhan_vien)
 {
     US_GD_CONG_TAC v_us = new US_GD_CONG_TAC();
     DS_GD_CONG_TAC v_ds = new DS_GD_CONG_TAC();
     v_us.FillDatasetDonViHienTai(v_ds, v_id_nhan_vien);
     if (v_ds.Tables[0].Rows.Count == 0)
         return null;
     else return v_ds.Tables[0].Rows[0];
 }
 public US_GD_CONG_TAC()
 {
     pm_objDS = new DS_GD_CONG_TAC();
     pm_strTableName = c_TableName;
     pm_objDR = pm_objDS.Tables[pm_strTableName].NewRow();
 }
 public void FillDatasetDonViHienTai(DS_GD_CONG_TAC v_ds, decimal ip_id_nv)
 {
     CStoredProc v_cstore = new CStoredProc("pr_CT_get_cong_tac_hien_tai");
     v_cstore.addDecimalInputParam("@ip_id_nv", ip_id_nv);
     v_cstore.fillDataSetByCommand(this, v_ds);
 }
        private bool loai_ctac_cthuc_isExist(decimal ip_dc_id_nv, decimal ip_dc_id_loai_ct)
        {
            US_GD_CONG_TAC v_us = new US_GD_CONG_TAC();
            DS_GD_CONG_TAC v_ds = new DS_GD_CONG_TAC();

            v_us.FillDataset(v_ds);

            string v_str_filter = "ID_NHAN_VIEN = " + ip_dc_id_nv + "AND DA_XOA = 'N' AND ID_LOAI_CONG_TAC = " + ip_dc_id_loai_ct;
            DataRow[] v_dr = v_ds.GD_CONG_TAC.Select(v_str_filter);

            if (v_dr.Count() == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        private decimal find_id_gd_ct(decimal ip_dc_id_nv)
        {
            US_GD_CONG_TAC v_us = new US_GD_CONG_TAC();
            DS_GD_CONG_TAC v_ds = new DS_GD_CONG_TAC();

            v_us.FillDataset(v_ds);

            string v_str_filter = "ID_NHAN_VIEN = " + ip_dc_id_nv + "AND DA_XOA = 'N'";
            DataRow[] v_dr = v_ds.GD_CONG_TAC.Select(v_str_filter);

            if (v_dr.Count() == 0)
            {
                return -1;
            }
            else
            {
                return CIPConvert.ToDecimal(v_dr.First()["ID"].ToString());
            }
        }
 private void load_data_to_grid()
 {
     US_GD_CONG_TAC v_us = new US_GD_CONG_TAC();
     DS_GD_CONG_TAC v_ds = new DS_GD_CONG_TAC();
     v_ds.EnforceConstraints = false;
     m_grc.DataSource = v_us.LayDuLieuCongTac(get_option_filter(), get_thang(), get_nam());
 }