Solved

Any one Help me I want to convert vb code  to c# code

Posted on 2007-11-15
3
320 Views
Last Modified: 2008-03-06
Private Function GetAuthCode(ByVal pVisaType As String, ByVal pCustID As String, ByVal pCustName As String, ByVal pCustPhone As String, ByVal pCCNO As String, ByVal pCVVNO As String, ByVal pEMail As String, ByVal pCCExpMonth As String, ByVal pCCExpYear As String, ByVal pCSUID As String, ByVal pbtaAdd1 As String, ByVal pbtaAdd2 As String, ByVal pbtaAdd3 As String, ByVal pbtaCity As String, ByVal pbtaState As String, ByVal pbtaZip As String, ByVal pbtaCountry As String, ByVal pstaAdd1 As String, ByVal pstaAdd2 As String, ByVal pstaAdd3 As String, ByVal pstaCity As String, ByVal pstaState As String, ByVal pstaZip As String, ByVal pstaCountry As String, ByRef pMerchant As Merchant) As String
     Dim sAuthCode As String
    Dim sqltext As String
    Dim sBillAdd As String
     sBillAdd = pbtaAdd1 & ", " & pbtaAdd2 & ", " & pbtaAdd3 & ", " & pbtaCity & ", " & pbtaState & ", " & pbtaZip & ", " & pbtaCountry
     Set oPostLib = New PostLib
     Set oCInfo = New CardInfo
    Set oMPI = New MPIData
     Set oBTA = New BillToAddress
     Set oSTA = New ShipToAddress
     Set oPGResp = New PGResponse
     oBTA.setAddressDetails pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail
     oSTA.setAddressDetails pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail
     oCInfo.setCardDetails pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI"
   oMPI.setMPIResponseDetails "05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", ""
    Set oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA)
   sAuthCode = oPGResp.getAuthIdCode
    pPNRNO = oPGResp.getRRN & ""
   On Error GoTo TrapError
    GetAuthCode = sAuthCode
   Exit Function
TrapError:
    GetAuthCode = sAuthCode & "@sqlQuery@" & sqltext
End Function
0
Comment
Question by:sitg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 20288637

private string GetAuthCode(string pVisaType, string pCustID, string pCustName string pCustPhone,
    string pCCNO, string pCVVNO, string pEMail, string pCCExpMonth, string pCCExpYear,
    string pCSUID, string pbtaAdd1, string pbtaAdd2, string pbtaAdd3, string pbtaCity,
    string pbtaState, string pbtaZip, string pbtaCountry, string pstaAdd1, string pstaAdd2,
    string  pstaAdd3, string pstaCity, string pstaState, string pstaZip, string pstaCountry,
    ref Merchant pMerchant)
 
        string sAuthCode, sqltext, sBillAdd;
 
        sBillAdd = string.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}", pbtaAdd1, pbtaAdd2,
            pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry);
        PostLib oPostLib = new PostLib();
        CardInfo oCInfo = new CardInfo();
        MPIData oMPI = new MPIData();
        BillToAddress oBTA = new BillToAddress();
        ShipToAddress oSTA = new ShipToAddress();
        PGResponse oPGResp = new PGResponse();
 
     oBTA.setAddressDetails(pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail);
     oSTA.setAddressDetails(pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail);
     oCInfo.setCardDetails(pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI"
   oMPI.setMPIResponseDetails, "05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", "");
    oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);
    sAuthCode = oPGResp.getAuthIdCode();
    pPNRNO = oPGResp.getRRN.ToString();
 
    try
    {
        GetAuthCode = sAuthCode
    }
    catch
    {
        GetAuthCode = sAuthCode + "@sqlQuery@" + sqltext;
    }
}

Open in new window

0
 
LVL 18

Assisted Solution

by:ChetOS82
ChetOS82 earned 250 total points
ID: 20288660
private string GetAuthCode(string pVisaType, string pCustID, string pCustName, string pCustPhone, string pCCNO, string pCVVNO, string pEMail, string pCCExpMonth, string pCCExpYear, string pCSUID,
string pbtaAdd1, string pbtaAdd2, string pbtaAdd3, string pbtaCity, string pbtaState, string pbtaZip, string pbtaCountry, string pstaAdd1, string pstaAdd2, string pstaAdd3,
string pstaCity, string pstaState, string pstaZip, string pstaCountry, ref Merchant pMerchant)
{
      string sAuthCode;
      string sqltext;
      string sBillAdd;
      sBillAdd = pbtaAdd1 + ", " + pbtaAdd2 + ", " + pbtaAdd3 + ", " + pbtaCity + ", " + pbtaState + ", " + pbtaZip + ", " + pbtaCountry;

      PostLib oPostLib = new PostLib();
      CardInfo oCInfo = new CardInfo();
      MPIData oMPI = new MPIData();
      BillToAddress oBTA = new BillToAddress();
      ShipToAddress oSTA = new ShipToAddress();
      PGResponse oPGResp = new PGResponse();

      oBTA.setAddressDetails(pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail);
      oSTA.setAddressDetails(pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail);
      oCInfo.setCardDetails(pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI");
      oMPI.setMPIResponseDetails("05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", "");

      oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);
      sAuthCode = oPGResp.getAuthIdCode();
      pPNRNO = oPGResp.getRRN();

      try {
            return sAuthCode
      } catch (Exception ex) {
            return sAuthCode + "@sqlQuery@" & sqltext;
      }
}
0
 

Author Comment

by:sitg
ID: 20310387
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question