BKI_DichVuMatDat.NghiepVu.f372_nhan_vien_loai_lao_dong_excel.find_id_nhan_vien_by_ma_nv C# (CSharp) Method

find_id_nhan_vien_by_ma_nv() private method

private find_id_nhan_vien_by_ma_nv ( string ip_str_ma_nv ) : decimal
ip_str_ma_nv string
return decimal
        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;
            }
        }