Beispiel #1
0
        public async Task <IActionResult> GetPegawaiInfoByNip(string id)
        {
            var result = await GetStringAsync("/hris/api/pegawai/GetPegawaiInfoByNip/" + id);

            if (result != null)
            {
                PegawaiInfo model = JsonConvert.DeserializeObject <PegawaiInfo>(result);
                // set nip
                model.NIP = model.NIP18;
                return(Ok(new ResultModel {
                    isSuccessful = true, data = model
                }));
            }
            else
            {
                return(Ok(new ResultModel {
                    isSuccessful = false, message = "Gagal mengambil info data pegawai."
                }));
            }
        }
Beispiel #2
0
        public static void SetUserCache(PegawaiInfo pegawaiInfo, string nip, IDistributedCache _cache)
        {
            var options = UserHelper.CacheOptions();

            _cache.SetString(nip + "-RoleName", pegawaiInfo.RoleName, options);
        }