Solved

Multi Line Coding in VB.Net for passing parameter

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

24 Experts available now in Live!

Get 1:1 Help Now