Solved

Multi Line Coding in VB.Net for passing parameter

Posted on 2010-08-27
4
291 Views
Last Modified: 2013-11-27


I want to break this Single line Parameter passing code in Multi line..

Multi line coding will be easier to understand and debug
objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(), Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(), cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text), txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text), Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text), strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(), Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(), rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(), txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text, Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text), cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(), cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(), cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(), cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(), Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(), txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))

Open in new window

0
Comment
Question by:chokka
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Zhaolai earned 500 total points
ID: 33546429
Try this:

        objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(),
                               Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(),
                               cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text),
                               txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text),
                               Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text),
                               strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(),
                               Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(),
                               rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(),
                               txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text,
                               Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text),
                               cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(),
                               cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(),
                               cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(),
                               cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(),
                               Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(),
                               txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))


Or

        objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(), _
                               Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(), _
                               cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text), _
                               txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text), _
                               Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text), _
                               strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(), _
                               Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(), _
                               rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(), _
                               txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text, _
                               Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text), _
                               cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(), _
                               cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(), _
                               cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(), _
                               cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(), _
                               Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(), _
                               txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))


0
 

Author Comment

by:chokka
ID: 33546462


Can you please help me in this Function header ..
Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String, ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String, ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date, ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer, ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean, ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer, ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean, ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String, ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String, ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String, ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer, ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer, ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String, ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer, ByVal strCaseManager As String, ByVal strOrganization As String, ByVal intCMPhone As Integer, ByVal strReferredBy As String, ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)

Open in new window

0
 
LVL 17

Assisted Solution

by:Zhaolai
Zhaolai earned 500 total points
ID: 33546481
Here it is:

    Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String,
                                ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String,
                                ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date,
                                ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer,
                                ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean,
                                ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer,
                                ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean,
                                ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String,
                                ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String,
                                ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String,
                                ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer,
                                ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer,
                                ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String,
                                ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer,
                                ByVal strCaseManager As String, ByVal strOrganization As String,
                                ByVal intCMPhone As Integer, ByVal strReferredBy As String,
                                ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)

Or

    Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String, _
                            ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String, _
                            ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date, _
                            ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer, _
                            ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean, _
                            ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer, _
                            ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean, _
                            ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String, _
                            ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String, _
                            ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String, _
                            ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer, _
                            ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer, _
                            ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String, _
                            ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer, _
                            ByVal strCaseManager As String, ByVal strOrganization As String, _
                            ByVal intCMPhone As Integer, ByVal strReferredBy As String, _
                            ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)
0
 

Author Closing Comment

by:chokka
ID: 33546529
Thanks for helping me ..
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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

932 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

11 Experts available now in Live!

Get 1:1 Help Now