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-16
6
Medium Priority
?
255 Views
Last Modified: 2007-11-18
Public Function GetPGResponse(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 PGResponse
  ''used public in ICICI_PG_Lib13.dll version 1.3.0
   
    'Main Function meant for using by applications
    Dim sAuthCode As String
    Dim sqltext As String
    Dim sBillAdd As String
   
    'Collect Billing Address from Address Fields
    sBillAdd = pbtaAdd1 & ", " & pbtaAdd2 & ", " & pbtaAdd3 & ", " & pbtaCity & ", " & pbtaState & ", " & pbtaZip & ", " & pbtaCountry
   
    'Initialise Post Class
    Set oPostLib = New PostLib
   
    'Initialise CardInfo Class
    Set oCInfo = New CardInfo
   
    'Initialise MPIData Class
    Set oMPI = New MPIData
    'Initialise Billing Address
    Set oBTA = New BillToAddress
    'Initialise Shipping Address
    Set oSTA = New ShipToAddress
   
    'Initialise Payment Gate Response Object
    Set oPGResp = New PGResponse
   
   
    'Set Billing Address
    oBTA.setAddressDetails pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail
       
    'Set Shipping Address
    oSTA.setAddressDetails pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail
   
    'Set Card Details
    oCInfo.setCardDetails pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI"
   
    'Set MPI Response Details
    oMPI.setMPIResponseDetails "05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", ""
   
    'Post Data through oPostLib.postMOTO function and set oPGResp Object
    Set oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA)
   
   
    Set GetPGResponse = oPGResp
   
   
    Exit Function
TrapError:
    Set GetPGResponse = Nothing

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
6 Comments
 
LVL 10

Accepted Solution

by:
digitalZo earned 1760 total points
ID: 20303562

  public PGResponse GetPGResponse(
                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) {
        // 'used public in ICICI_PG_Lib13.dll version 1.3.0
        // Main Function meant for using by applications
        string sAuthCode;
        string sqltext;
        string sBillAdd;
        // Collect Billing Address from Address Fields
        sBillAdd = (pbtaAdd1 + (", " 
                    + (pbtaAdd2 + (", " 
                    + (pbtaAdd3 + (", " 
                    + (pbtaCity + (", " 
                    + (pbtaState + (", " 
                    + (pbtaZip + (", " + pbtaCountry))))))))))));
        // Initialise Post Class
        oPostLib = new PostLib();
        // Initialise CardInfo Class
        oCInfo = new CardInfo();
        // Initialise MPIData Class
        oMPI = new MPIData();
        // Initialise Billing Address
        oBTA = new BillToAddress();
        // Initialise Shipping Address
        oSTA = new ShipToAddress();
        // Initialise Payment Gate Response Object
        oPGResp = new PGResponse();
        // Set Billing Address
        oBTA.setAddressDetails;
        pCustID;
        pCustName;
        pbtaAdd1;
        pbtaAdd2;
        pbtaAdd3;
        pbtaCity;
        pbtaState;
        pbtaZip;
        pbtaCountry;
        pEMail;
        // Set Shipping Address
        oSTA.setAddressDetails;
        pstaAdd1;
        pstaAdd2;
        pstaAdd3;
        pstaCity;
        pstaState;
        pstaZip;
        pstaCountry;
        pEMail;
        // Set Card Details
        oCInfo.setCardDetails;
        pVisaType;
        pCCNO;
        pCVVNO;
        pCCExpYear;
        pCCExpMonth;
        pCustName;
        "CREDI";
        oMPI.setMPIResponseDetails;
        "05";
        "NTBlZjRjMThjMjc1NTUxYzk1MTY=";
        "";
        "";
        "";
        "";
        oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);
        return oPGResp;
        
    TrapError:
        return null;
    }

Open in new window

0
 
LVL 10

Assisted Solution

by:digitalZo
digitalZo earned 1760 total points
ID: 20303998
The VB code you provided is not correct. Did the VB code compile without any glitches? The above code is not going to work.

Anyway,  I modified it a bit and then converted. Let me know if this works:
PGResponse GetPGResponse(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)
    // 'used public in ICICI_PG_Lib13.dll version 1.3.0
 
    // Main Function meant for using by applications
 
    {
        string sAuthCode;
        string sqltext;
        string sBillAdd;
        // Collect Billing Address from Address Fields
 
        sBillAdd = pbtaAdd1+ ", "+ pbtaAdd2+ ", "+ pbtaAdd3+ ", "+ pbtaCity+ ", "+ pbtaState+ ", "+ pbtaZip+ ", "+ pbtaCountry;
        // Initialise Post Class
 
        Set oPostLib = new PostLib;
        // Initialise CardInfo Class
 
        Set oCInfo = new CardInfo;
        // Initialise MPIData Class
 
        Set oMPI = new MPIData;
        // Initialise Billing Address
 
        Set oBTA = new BillToAddress;
        // Initialise Shipping Address
 
        Set oSTA = new ShipToAddress;
        // Initialise Payment Gate Response Object
 
        Set oPGResp = new PGResponse;
        // Set Billing Address
 
        oBTA.setAddressDetails(pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail);
        // Set Shipping Address
 
        oSTA.setAddressDetails(pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail);
        // Set Card Details
 
        oCInfo.setCardDetails(pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI");
        // Set MPI Response Details
 
        oMPI.setMPIResponseDetails("05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", "");
        // Post Data through oPostLib.postMOTO function and set oPGResp Object
 
        Set oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);
        Set GetPGResponse = oPGResp;
        break;
    }
 
    // TrapError:
 
    GetPGResponse Set = null;

Open in new window

0
 
LVL 12

Assisted Solution

by:Mortaza Doulaty
Mortaza Doulaty earned 80 total points
ID: 20306945
You can google "VB to C# Convertor" a list of result you will see.
There are even online code converters...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 160 total points
ID: 20307353
0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 160 total points
ID: 20307354
0
 

Author Comment

by:sitg
ID: 20310372
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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

721 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