Solved

Multi Line Coding in VB.Net for passing parameter

Posted on 2010-08-27
4
294 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

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

808 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