Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-11-15
3
Medium Priority
?
341 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 750 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 750 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

670 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