示例#1
0
        private async void btnDownLoadApiSetting_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(GstSession.ApiSetting.AspWebsite))
                {
                    GstSession.ApiSetting.AspWebsite = "www.taxprogsp.co.in";
                }

                TxnResp txnResp = await GspAPI.DownLoadAPISettingsAsync(GstSession);

                //Force refresh of ApiSetting
                GSTSession gs = GstSession;
                GstSession         = null;
                GstSession         = gs;
                txtASPName.Text    = GstSession?.ApiSetting?.ASPName ?? "";
                txtAspWebsite.Text = GstSession?.ApiSetting?.AspWebsite ?? "";
                txtUrlAuth.Text    = GstSession?.ApiSetting?.UrlAuth ?? "";
                txtUrlReturn.Text  = GstSession?.ApiSetting?.UrlReturn ?? "";
                txtUrlAspUtil.Text = GstSession?.ApiSetting?.UrlAspUtil ?? "";
                lblAPIMsg.Text     = txnResp.TxnOutcome;
            }
            catch (Exception ex)
            {
                lblAPIMsg.Text = ex.Message;
            }
        }
示例#2
0
        private async void btnRegenerateAspDscCertificate_Click(object sender, EventArgs e)
        {
            if (GenerateAspDsc())
            {
                try
                {
                    string  strCertPath = AppDomain.CurrentDomain.BaseDirectory + @"AspDsc.cer";
                    TxnResp txnResp     = await GspAPI.SetAspPublicCertAsync(GstSession, strCertPath);

                    lblAPIMsg.Text = txnResp.TxnOutcome;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }