Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net dynamic formulas in runtime 11 63
Error on Add method 1 38
ASP.net Have sliders change in order 2 10
Gridview alignment 1 12
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now