Solved

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

Posted on 2007-11-15
3
306 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

810 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