/// <summary>
        /// 取得中獎號碼
        /// </summary>
        /// <param name="invTerm">查詢的期別</param>
        /// <returns></returns>
        public QryWinningListResultViewModel GetWinningList(QryWinningListViewModel viewModel)
        {
            var model      = mapper.Map <QryWinningListModel>(viewModel);
            var resultJson = ExcuteApi(model);

            return(JsonConvertFacde.DeserializeObject <QryWinningListResultViewModel>(resultJson));
        }
Example #2
0
        private string GetSysErrorMsg()
        {
            var result = new
            {
                v    = "1.0",
                code = "999",
                msg  = "財政部電子發票資訊中心系統異常,請稍候再試或洽客服人員"
            };

            return(JsonConvertFacde.SerializeObject(result));
        }
        public override string ExcuteApi(QryWinningListModel model)
        {
            //這裡可以讀取DB的資料 我偷懶所以寫死資料
            QryWinningListResult MockResult = new QryWinningListResult()
            {
                code           = "200",
                msg            = "OK",
                firstPrizeNo1  = "1234",
                firstPrizeNo10 = "123345"
            };

            return(JsonConvertFacde.SerializeObject(MockResult));
        }
        public List <InvoiceViewModel> GetInvoice(CarrierTilteViewModel viewModel)
        {
            var    carrierTitleModel            = mapper.Map <CarrierTilteModel>(viewModel);
            string result                       = ExcuteApi(carrierTitleModel);
            var    title                        = JsonConvertFacde.DeserializeObject <CarrierTitleResult>(result);
            List <InvoiceViewModel> InvoiceList = null;

            //查詢成功再加入List中
            if (title.code == "200")
            {
                InvoiceList = mapper.Map <List <InvoiceViewModel> >(title.details);
            }
            return(InvoiceList ?? new List <InvoiceViewModel>());
        }
 public TRtn ExecuteApi <TRtn>(TModel model)
 {
     return(JsonConvertFacde.DeserializeObject <TRtn>(ExecuteApi(model)));
 }
Example #6
0
        public async Task <TRtn> ExecuteApiAsync <TRtn>(TModel model)
        {
            var result = await ExecuteApiAsync(model);

            return(JsonConvertFacde.DeserializeObject <TRtn>(result));
        }
Example #7
0
 public JsonConfig(string JsonData)
 {
     _configModel = JsonConvertFacde.DeserializeObject <ConfigModel>(JsonData);
 }