.NET Forum / ASP.NET / General / September 2007
OOP Oversold??
|
|
Thread rating:  |
dancer - 26 Sep 2007 21:33 GMT I haven't given up yet, but I'm wondering if OOP is worth the effort. I know that almost everybody in this forum thinks OOP is the only way to go, but is there anybody out there who believes differently? 1. Is there anybody who believes that programming patterns will change in the near future and leave OOP behind?
2. I *love* Asp.net. Is there any language to use presently in ASP.net that uses the TRADITIONAL method of programming?
3. I chose VB.Net to learn because it looked similar to other vb I had used on occasion. On first blush it seemed LOGICAL, as other programming languages I had used in the past. And it is....... until I am told my code is all wrong because it doesn't use the oop processes.
Is it possible to program with VB.net using traditional logic, without the OOP? (**Using it only for web applications**)
4. If number 3 is true, who can tell me how to get help without somebody insisting on OOP?
5. Do I need to be in a different forum? If so, Where?
Juan T. Llibre - 26 Sep 2007 21:46 GMT re: !> I haven't given up yet, but I'm wondering if OOP is worth the effort.
If you want to use interpreted languages, instead of compiled .Net languages which rely on OOP, you're quite free to do so, in the understanding that you're going to give up a lot of efficiency.
IIRC, .Net provides about 3-4 times the throughtput that ASP did. That is achieved by using OOP, assembly compilation and JIT compilation.
I wouldn't give that up easily, just to stay inside the "traditional" programming realm.
Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ ======================================
>I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to go, but is there anybody out there who [quoted text clipped - 14 lines] > > 5. Do I need to be in a different forum? If so, Where? darrel - 26 Sep 2007 21:49 GMT > I know that almost everybody in this forum thinks OOP is the only way to > go, but is there anybody out there who believes differently? OOP is great in organizations that depend on creating and maintaining huge enterprise applications over a period of time (what .net seems to be marketed at).
A lot of web sites, however, do just fine with inline PHP scripting. And don't really see much (if any) benefit to an OOP model.
> 1. Is there anybody who believes that programming patterns will change in > the near future and leave OOP behind? Trends these days seem to be to use 'frameworks' that simply help with the OOP part.
> 2. I *love* Asp.net. Is there any language to use presently in ASP.net > that uses the TRADITIONAL method of programming? What is 'traditional'?
> 3. I chose VB.Net to learn because it looked similar to other vb I had > used on occasion. On first blush it seemed LOGICAL, as other programming > languages I had used in the past. And it is....... until I am told my > code is all wrong because it doesn't use the oop processes. Right, you can write all the inline VB code you want.
C# tends to force your hand a bit, as it's syntax is a lot like Java to embrace the OOP concepts from the start.
> Is it possible to program with VB.net using traditional logic, without the > OOP? (**Using it only for web applications**) Yes.
> 4. If number 3 is true, who can tell me how to get help without somebody > insisting on OOP? Here. Just don't get too upset with you get a lot of OOP-centric answers as most .net folks are OOP folks.
If you really don't want to deal with OOP to build web sites, consider using PHP, ColdFusion, or maybe looking at Ruby on Rails, which does use OOP, but tends to auomate a lot of that process for you.
-Darrel
dancer - 27 Sep 2007 16:03 GMT Hi Darrell, Thank you for your very thoughtful and expert answers. Could you do me the favor of looking at this code and answer the following questions? (It maybe seems long, but it is a very simple application - just a lot of variables) I will be VERY grateful, and it will help me move on. The purpose of the application is to get information from the user, then send this information to a manager by email and send the SAME information to a database upon the user clicking "Submit.". (I am limited to asp.net 1.1)
* The code gives me the results I want, with one exception, which I will address in number 2. *
1.How does the second subroutine, "btnsendDatabase_OnClick" know what the variables are, when I have declared them within the *first* subroutine, "btnSendMail_OnClick"? (It always sends the information to the database properly.) If I try to declare the variables *outside* the subroutine, I get the error, "Object reference not set to an instance of an object."
2. As I want, if the user clicks Submit without having chosen something other than the default from the drop-down boxes (the default being "choose one") the user receives an error message and is exited from the subroutine, and the email does not go until he makes an appropriate selection. *Now, the one exception to the results I want:* If the user clicks Submit without having made a different selection from the drop-down boxes the information is sent to the database anyway, - as you would expect - because the if, then code controlling that is not in the sendDatabase subroutine. However, if I try to put that code in the second subroutine, I get errors of the variable not declared. BUT, as I mentioned in number 1, the subroutine sends the values of the variables gotten in the first sub to the database!!
3. If I try to use strict OOP programming with this little project, will I have to put all those variables in the second sub (or method) in the form, for example, of "xx.TheEmpName"-, taking a long time and a lot of keystrokes?
(By the way, I DO know that   is bad form and I need to use CSS. I'm working on that) THANKS A BUNCH! ****************************************************************************************** <%@ Page Language="VB" Debug = "true" ValidateRequest="false" %> <%@ Import Namespace="System.Web.Mail" %>
<%@ Import Namespace="System.Data.Oledb" %>
<script language="VB" runat="server">
Sub SendMailandDatabase(Source As Object, E As EventArgs)
btnSendMail_OnClick
btnSendDatabase_OnClick
End Sub
Sub btnSendMail_OnClick
Dim TheEmpName As String = EmpName.text
Dim TheHomeNumber As String = HomeNumber.text
Dim TheDateofAccident As String = DateofAccident.Text
Dim TheNotifyDate As String = NotifyDate.Text
Dim TheTimeAM As String = am.Text
Dim TheTimePM As String = pm.Text
Dim TheTime As String
Dim Thedie As String = Die.SelectedItem.Text
Dim TheLostDays As String = LostDays.SelectedItem.Text
Dim TheStateOfInjury As String = StateOfInjury.Text
Dim TheStreet As String = street.text
Dim TheCity As String = city.text
Dim TheAddressState as String = AddressState.Text
Dim TheZip As String = Zip.text
Dim Thebirth as String = Birth.Text
Dim TheSSN As String = SSN.text
Dim TheSex As String = Sex.SelectedItem.Text
Dim TheMarital As String = Marital.SelectedItem.Text
Dim TheContactNumber As String = ContactNumber.Text
Dim TheJob As string = Job.SelectedItem.Text
Dim ThePart As String = Part.Text
Dim TheSupervisor As String = Supervisor.Text
Dim TheHours As String = Hours.Text
Dim TheDays As String = Days.Text
Dim TheNature As String = nature.SelectedItem.Text
'Dim TheNatureNew As String
Dim TheDescription As String = Description.Text
Dim TheCaused As String = Caused.Text
Dim TheInitial As String = Initial.SelectedItem.Text
Dim TheProvider As String = Provider.SelectedItem.Text
Dim TheAdmitted As String = Admitted.SelectedItem.Text
Dim TheProviderName as String = ProviderName.Text
Dim TheProviderStreet as string = ProviderStreet.Text
Dim TheProviderCity as string = ProviderCity.Text
Dim TheProviderPhone as string = ProviderPhone.Text
Dim Thefull as String = Full.Text
Dim TheFullNew As String
Dim TheOccur As String = Occur.SelectedItem.Text
Dim TheWhere As String = Where.Text
Dim TheAccidentStreet As String = AccidentStreet.Text
Dim TheAccidentCity As String = AccidentCity.Text
dim TheAccidentState as String = AccidentState.Text
Dim TheAccidentZip as String = AccidentZip.Text
Dim TheOtherClaims as String = OtherClaims.SelectedItem.Text
Dim TheSafetyDevices as string = SafetyDevices.selectedItem.Text
Dim TheDevicesUtilized as string = DevicesUtilized.selectedItem.Text
Dim TheWitness as string = Witness.SelectedItem.Text
Dim TheWitnessName as String = WitnessName.Text
Dim TheReceivePay as String = ReceivePay.SelectedItem.Text
Dim TheComments as String = Comments.Text
Dim TheCommentsNew as String
Dim ThePrevented as String = Prevented.Text
Dim ThePreventedNew as String
Dim TheSubmitter As String = Submitter.Text
Dim TheTitle As String = Title.Text
Dim TheToday As String = Today.Text
Dim TheLocation As String = Location.SelectedItem.Text
Dim myMessage As New MailMessage
Dim myMail As SmtpMail
Dim strEmail As String
Dim UserMessage As String
'**********************puts AM or PM with time and forces user to enter a time*******************
If TheTimeAm <> "" Then
TheTime = TheTimeAm & " AM"
ElseIf TheTimePM <> "" Then
TheTime = TheTimePM & " PM"
Else TheTime = ""
End If
If TheTime = "" then
Response.Write("<font color=""red"">ERROR: You must enter a time</font>")
Exit Sub
End If
'******************* forces the user to choose other than default from a drop-down box********************
If TheJob = "Choose One" Then
Response.Write("<font color=""red"">ERROR: You must Choose a Job Description</font>")
Exit Sub
End If
If TheNature = "Choose One" Then
Response.Write("<font color=""red"">ERROR: You must Select the Nature of the Injury</font>")
Exit Sub
End If
If TheLocation = "Choose One" Then
Response.Write("<font color=""red"">ERROR: You must Choose a Wheeler's Division</font>")
Exit Sub
End If
'***************************FORCES A LINE BREAK IN THE REPORT**************************
TheCommentsNew = TheComments.Replace(vbCrLf,"<br />")
ThePreventedNew = ThePrevented.Replace(vbCrLf,"<br />")
TheFullNew = TheFull.Replace(vbCrLf,"<br />")
'***************************SENDS EMAIL****************************************
If Page.IsValid() Then
Response.Write ("<font color=""red"">FORM HAS BEEN SENT TO RIVERSIDE</font>")
myMessage.From = "shs@wheelers.com"
MyMessage.To = "xxxxxx.xxxxxxt@xxxxxx.com;"
myMessage.Subject = "Accident Form"
MyMessage.BodyFormat = MailFormat.Html
myMessage.Body = "<h2>Wheeler's Express Accident Report Form</h2>" & vbCrLf _
& " <p>" & vbCrLf _
& "<html><body> <table width = ""750"" bgcolor=""#E9EDF4"" height=""25"" border=""1"" cellpadding=""1"" cellspacing=""0""fontface=""Verdana"" Size=""2"">" & vbCrLf _
& "<td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> BASIC CLAIM FACTS</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Employee's Name: <b> " & TheEmpName & "</b></td>" & vbCrLf _
& "<td colspan=""2""> <font face=""Verdana"" Size=""2"">Home Phone Number: <b>"& TheHomeNumber & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Date of Injury: <b>" & TheDateOfAccident & "<br>" & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Time of Injury: <b>" & TheTime & "<br>" & "</td></tr>" & "</b></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Date Employer Notified:<b> " & TheNotifyDate & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Did Employee Die?<b> " & Thedie & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""1""> <font face=""Verdana"" Size=""2"">Has the Injured Employee Lost Days From Work?<b> " & TheLostDays & "</b></td>" & vbCrLf _
& "<td colspan=""2""> <font face=""Verdana"" Size=""2"">What State Did Injury Occur? <b> " & TheStateOfInjury & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> EMPLOYER INFORMATION</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""> <font face=""Verdana"" Size=""2"">Employer Name: </td></tr>" & vbCrLf _
& "<tr><td height=""35"" valign=""bottom"" colspan=""3""><font face=""Verdana"" Size=""2""> Work Location: <font face=""Verdana"" Size=""1""> (street)                        " & vbCrLf _
& "(city)                        (state)                        (Zip)</td></tr>" & vbCrLf _
& "<tr><td colspan=""3""> <font face=""Verdana"" Size=""2"">Nature of Business: </td></tr>" & vbCrLf _
& "<tr><td colspan=""3""> <font face=""Verdana"" Size=""2"">Employee FED ID: </td></tr>" & vbCrLf _
& "<tr><td colspan=""3""> <font face=""Verdana"" Size=""2"">Liberty Mutual Policy #             " & vbCrLf _
& "                                     Store# </td></tr>" & vbCrLf _
& "<tr><td colspan=""1""> <font face=""Verdana"" Size=""2"">Employer Code: </td>" & vbCrLf _
& "<td colspan=""2""> <font face=""Verdana"" Size=""2"">Employer Location Code: </td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Employer SIC Code: </td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Employer Type: </td></tr>" & vbCrLf _
& "<tr><td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> INJURED EMPLOYEE </b></td></tr>" & vbCrLf _
& "<tr><td colspan= ""3""><font face=""Verdana"" Size=""2""> Home Address: <b>" & TheStreet & "      " & TheCity & "      " & TheAddressState & "   " & TheZip & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Date of Birth:<b>" & TheBirth & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">SSN:<b> " & TheSSN & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2""><b> " & TheSex & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Marital Status:<b> " & TheMarital & "</b></td>" & vbCrLf _
& "<tr><td colspan = ""3""> <font face=""Verdana"" Size=""2"">Phone Number where Employee can be contacted:<b> " & TheContactNumber & "</b></td></tr>" & vbCrLf _
& "<tr><td><font face=""Verdana"" Size=""2"">Job Description:<b> " & TheJob & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2"">Supervisor's Name:<b> " & TheSupervisor & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2""> Hire Date: " & "</b></td></tr>" & vbCrLf _
& "<td colspan=""2""> <font face=""Verdana"" Size=""2"">Work Per Week <b>" & TheHours & "</b>   Hours <b>" & TheDays & "</b>   Days </b> </td>" & vbCrLf _
& "<tr><td><font face=""Verdana"" Size=""2""></td></tr>" & vbCrLf _
& "<tr><td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> INJURY OR ILLNESS </b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""> <font face=""Verdana"" Size=""2"">Which Part of the Body Was Injured? <b> " & ThePart & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> What was the Nature of Injury? <b>" & TheNature & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Injury/Illness Description <b> " & TheDescription & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Initial Medical Treatment: <b> " & TheInitial & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2"">What Type of Medical Provider Performed Treatment? <b>" & TheProvider & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Was Employee Admittted into a Hospital? <b>" & TheAdmitted & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Medical Provider Name: <b>" & TheProviderName & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Medical Provider Address: <b>" & TheProviderStreet & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Medical Provider City State: <b>" & TheProviderCity & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Medical Provider Phone: <b>" & TheProviderPhone & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Give a Full Description of the Accident: <b>" & TheFullNew & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> What Caused The Injury? <b>" & TheCaused & "</b></td></tr>" & vbCrLf _
& "<tr><td><font face=""Verdana"" Size=""2""> Did the Accident Occur at the Store or Plant? <b>" & TheOccur & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""2""> <font face=""Verdana"" Size=""2""> If No, where did the accident occur?<b>" & TheWhere & "</b></td>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Accident Address <b>" & TheAccidentStreet & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Accident City <b>" & TheAccidentCity & " " & TheAccidentState & " " & TheAccidentZip & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Are Other Claims Involved? <b>" & TheOtherClaims & "</b></td>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Safety Devices Provided? <b>" & TheSafetyDevices & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2""> Safety Devices Utilized? <b>" & TheDevicesUtilized & "</b></td></tr>" & vbCrLf _
& "<tr><td> <font face=""Verdana"" Size=""2""> Was There a Witness <b>" & TheWitness & "</b></td>" & vbCrLf _
& "<td colspan=""2""> <font face=""Verdana"" Size=""2""> If yes, ListName <b>" & TheWitnessName & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> DISABILITY STATUS </b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""> Did Employee Receive Pay for Date of Injury? <b>" & TheReceivePay & "</b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3"" bgcolor=""maroon"" align=""center""> <font face=""Verdana"" Size=""2"" color=""white""><b> ADDITIONAL COMMENTS & INFORMATION </b></td></tr>" & vbCrLf _
& "<tr><td colspan=""3""><font face=""Verdana"" Size=""2""><b>" & TheCommentsNew & " </b></td></tr>" & vbCrLf _
& "<tr> <td> <font face=""Verdana"" Size=""2"">Person submitting this form: " & "<b>" & theSubmitter & "</b></td>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Title: " & "<b>" & theTitle & "</b></td></tr>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Date: <b> " & Thetoday & "</b>" & vbCrLf _
& "<td> <font face=""Verdana"" Size=""2"">Location: <b> " & TheLocation & "</b>" & vbCrLf _
& "<tr> <td colspan=""3""> <font face=""Verdana"" Size=""2"">How can the above incident be prevented from happening again? " & "<b>" & ThePreventedNew & "</b></td>" & vbCrLf _
& "</td><tr></table> </body>"
'myMail.SmtpServer = "smtp.xxxxxx.com"
myMail.SmtpServer = ""
myMail.Send(myMessage)
frmEmail.Visible = False
UserMessage = "Has Been Sent."
End If
End Sub
'*************SEND TO DATABASE***************************************************************************
Sub btnSendDatabase_OnClick
Dim strConn As String = ("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Server.Mappath("~\Acc.mdb") & ";")
Dim MySql AS String = "INSERT INTO Table1(TheEmpName,TheDateOfAccident,TheNotifyDate,TheToday,TheBirth," & vbcrlf _
& "TheSSN, TheJob, TheSupervisor, ThePart, TheHours, TheDays, TheNature," & vbcrlf _
& "TheDescription, TheInitial, TheProvider, TheAdmitted, TheProviderName, TheOccur," & vbcrlf _
& "TheWhere,TheAccidentStreet,TheAccidentCity,TheAccidentState,TheAccidentZip," & vbcrlf _
& "TheOtherClaims, TheSafetyDevices, TheDevicesUtilized, TheWitness, TheWitnessName," & vbcrlf _
& "ThePreventedNew, TheSubmitter, TheTitle, TheLocation)" & vbcrlf _
& "VALUES(@TheEmpName, @TheDateOfAccident, @TheNotifyDate,@TheToday, @TheBirth," & vbcrlf _
& "@TheSSN, @TheJob, @TheSupervisor, @ThePart, @TheHours, @TheDays, @TheNature," & vbcrlf _
& "@TheDescription, @TheInitial, @TheProvider, @TheAmitted, @TheProviderName, @TheOccur," & vbcrlf _
& "@TheWhere,@TheAccidentStreet,@TheAccidentCity,@TheAccidentState, @TheAccidentZip," & vbcrlf _
& "@TheOtherClaims, @TheSafetyDevices, @TheDevicesUtilized, @TheWitness, @TheWitnessName," & vbcrlf _
& "@ThePreventedNew,@TheSubmitter, @TheTitle, @TheLocation)"
Dim MyConn as New OleDbConnection(strConn)
Dim Cmd as New OleDbCommand(MySQL, MyConn)
With Cmd.Parameters:
.Add(New OleDbParameter("@TheEmpName", EmpName.text))
.Add(New OleDbParameter("@TheDateOfAccident", DateOfAccident.Text))
.Add(New OleDbParameter("@TheNotifyDate", NotifyDate.Text))
.Add(New OleDbParameter("@TheToday", Today.Text))
.Add(New OleDbParameter("@TheBirth", Birth.Text))
.Add(New OleDbParameter("@TheSSN", SSN.Text))
.Add(New OleDbParameter("@TheJob", Job.SelectedItem.Text))
.Add(New OleDbParameter("@TheSupervisor", Supervisor.Text))
.Add(New OleDbParameter("@ThePart", Part.Text))
.Add(New OleDbParameter("@TheHours", Hours.Text))
.Add(New OleDbParameter("@TheDays", Days.Text))
.Add(New OleDbParameter("@TheNature", Nature.SelectedItem.Text))
.Add(New OleDbParameter("@TheDescription", Description.Text))
.Add(New OleDbParameter("@TheInitial", Initial.SelectedItem.Text))
.Add(New OleDbParameter("@TheProvider", Provider.SelectedItem.Text))
.Add(New OleDbParameter("@TheAdmitted", Admitted.SelectedItem.Text))
.Add(New OleDbParameter("@TheTheProviderName", ProviderName.Text))
.Add(New OleDbParameter("@TheOccur", Occur.SelectedItem.Text))
.Add(New OleDbParameter("@TheWhere", Where.Text))
.Add(New OleDbParameter("@TheAccidentStreet", AccidentStreet.Text))
.Add(New OleDbParameter("@TheAccidentCity", AccidentCity.Text))
.Add(New OleDbParameter("@TheAccidentState", AccidentState.Text))
.Add(New OleDbParameter("@TheAccidentZip", AccidentZip.Text))
.Add(New OleDbParameter("@TheOtherClaims", OtherClaims.SelectedItem.Text))
.Add(New OleDbParameter("@TheSafetyDevices", SafetyDevices.SelectedItem.Text))
.Add(New OleDbParameter("@TheDevicesUtilized", DevicesUtilized.SelectedItem.Text))
.Add(New OleDbParameter("@TheWitness", Witness.SelectedItem.Text))
.Add(New OleDbParameter("@TheWitnessName", WitnessName.Text))
.Add(New OleDbParameter("@ThePreventedNew", Prevented.Text))
.Add(New OleDbParameter("@TheSubmitter", Submitter.Text))
.Add(New OleDbParameter("@TheTitle", Title.Text))
.Add(New OleDbParameter("@TheLocation", Location.SelectedItem.Text))
end with
MyConn.Open()
cmd.ExecuteNonQuery()
MyConn.Close
End Sub
'**************************GET INFORMATION FROM USER********************************************
</script>
<html>
<head>
<title>ASP.NET Email (HTML Format) Sample</title>
</head>
<body>
<table width="750" bgcolor="#E9EDF4" table border="1" cellpadding="3">
<h3><center><font face="Verdana">Wheeler's Express Accident Report Form</font></center></h3>
<form method="post" id="frmEmail" runat="server">
<%--____________________________________________________________________________--%>
<%--Section 1--%>
<tr><td colspan="3" bgcolor="maroon" align="center"> <font face="Verdana" Size="2" color="white"><b> BASIC CLAIM FACTS</b></td></tr>
<td bgcolor="#E9EDF4" colspan="2">
<font face="Verdana" Size="2">
Employee's Name: <asp:textbox id="EmpName" runat=server columns="45"/>
<asp:RequiredFieldValidator id="RequiredFiedlValidator1" display=dynamic runat="server" Text="The Employee name is required."
ControlToValidate="EmpName"></asp:RequiredFieldValidator>
</td>
<%---------------------------------------------------------------------------%>
<td align="right" valign="top">
<font face="Verdana" Size="2">Home Phone Number
<asp:TextBox id=HomeNumber runat="server"/>
</td></tr>
<%--____________________________________________________________________________--%>
<%--ROW 2--%>
<tr><td colspan="1" valign="center">
<font face="Verdana" Size="2">Date of Injury </font>
<asp:textbox id="DateofAccident" runat=server /></asp:textbox>
<asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server"
Text="The Date field is required" ControlToValidate="Dateofaccident">
</asp:RequiredFieldValidator>
</td><td colspan="2"><font face="Verdana" Size="2">Time of Injury <asp:textbox columns="6" id ="am" runat=server/>a.m.
<asp:textbox columns="6" id= "pm" runat = server/> p.m.</td>
</TD>
</tr>
<tr>
<td>
<font face="Verdana" Size="2">Date Employer Notified <asp:textbox id="Notifydate" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorNotify" runat="server"
Text="This field is required" ControlToValidate="NotifyDate">
</asp:RequiredFieldValidator>
</td>
<td colspan="2"> <font face="Verdana" Size="2"> Did employee die? <asp:RadioButtonList id="Die" RepeatDirection="Horizontal" Runat=server>
<asp:ListItem><font face="Verdana" Size="2">Yes</asp:ListItem>
<asp:ListItem><font face="Verdana" Size="2">No</asp:ListItem> </asp:RadioButtonList>
</td></tr>
<tr><td> <font face="Verdana" Size="2"> Has the Injured Employee Lost Days From Work?
<asp:RadioButtonList id="LostDays" font-name="verdana" font-size="10 pt" RepeatDirection="Horizontal" Runat=server>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem> </asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorLostDays" Display=Dynamic runat="server"
Text="This field is required" ControlToValidate="LostDays">
</asp:RequiredFieldValidator>
<td colspan="3"><font face="Verdana" Size="2">What State did Injury Occur? <asp:textbox id="StateOfInjury" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorStateofInjury" Display=Dynamic runat="server"
Text="The State is required" ControlToValidate="StateOfInjury">
</asp:RequiredFieldValidator>
</td></tr>
<%--SECTION3-----------------------------------------------------------------------------------%>
<tr><td colspan="3" bgcolor="maroon" align="center"> <font face="Verdana" color="white" Size="2"><b> INJURED EMPLOYEE</b></td></tr>
<tr><td colspan="3"> <font face="Verdana" Size="2"> Home address Street <asp:TextBox id="street" columns="90" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorStreet" Display=Dynamic runat="server"
Text="The Street is required" ControlToValidate="Street">
</asp:RequiredFieldValidator>
</td></tr>
<tr><td> <font face="Verdana" Size="2"> City <asp:TextBox id="City" columns="40" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorCity" Display=Dynamic runat="server"
Text="The City is required" ControlToValidate="City">
</asp:RequiredFieldValidator>
</td><td> <font face="Verdana" Size="2"> State <asp:TextBox id="AddressState" columns="2" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorADdressState" Display=Dynamic runat="server"
Text="The State is required" ControlToValidate="AddressState">
</asp:RequiredFieldValidator>
</td> <td> <font face="Verdana" Size="2"> Zip <asp:TextBox id="Zip" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorZip" Display=Dynamic runat="server"
Text="The Zip field is required" ControlToValidate="Zip">
</asp:RequiredFieldValidator>
</td></tr>
<tr><td> <font face="Verdana" Size="2">Date of Birth: <asp:textbox id=birth columns="10" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorBirth" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Birth">
</asp:RequiredFieldValidator>
</td><td><font face="Verdana" Size="2"> SSN:<asp:textbox id=SSN columns="11" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorSSN" Display=Dynamic runat="server"
Text="The SSN field is required" ControlToValidate="SSN">
</asp:RequiredFieldValidator>
</td><td><font face="Verdana" Size="2"> Check one<asp:RadioButtonList id="Sex" RepeatDirection="Horizontal" runat="server">
<asp:ListItem><font face="Verdana" Size="2">Male</asp:ListItem>
<asp:ListItem><font face="Verdana" Size="2">Female</asp:ListItem> </asp:RadioButtonList>
</td></tr><td colspan="1"><font face="Verdana" Size="2"> Marital Status <asp:RadiobuttonList id=Marital RepeatDirection="Vertical"
runat=server>
<asp:ListItem> <font face="Verdana" Size="2"> Single </asp:ListItem>
<asp:ListItem><font face="Verdana" Size="2"> Married </asp:ListItem>
<asp:ListItem><font face="Verdana" Size="2"> Widowed </asp:ListItem>
<asp:ListItem><font face="Verdana" Size="2"> Divorced</asp:ListItem></asp:RadioButtonList>
</td><td colspan="2"><font face="Verdana" Size="2"> Phone Number where Employee can be Contacted: <asp:TextBox id=contactnumber runat=server/>
</td></tr><tr><td colspan="3"> <font face="Verdana" Size="2"> Job Description - Choose One <Asp:DropDownList id=Job runat=server>
<asp:ListItem Text="Choose One"/>
<asp:ListItem Text="Clerical"/>
<asp:ListItem Text="Driver"/>
<asp:ListItem Text="Door Manufacturing"/>
<asp:ListItem Text="Installed Sales"/>
<asp:ListItem Text="Manager"/>
<asp:ListItem Text="Puller"/>
<asp:ListItem Text="Sales"/>
<asp:ListItem Text="Shop Tech"/>
<asp:ListItem Text="Truss Manufacturing"/>
<asp:ListItem Text="Yard Worker"/>
<asp:ListItem Text="Warehouse Worker"/>
<asp:ListItem Text="Window Manufacturing"/>
</asp:DropDownList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorJob" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Job">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="2"> <font face="Verdana" Size="2"> Supervisor's Name <Asp:TextBox id=Supervisor Columns = "40" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorSupervisor" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Supervisor">
</asp:RequiredFieldValidator>
</td><td> <font face="Verdana" Size="2">Time Worked Per Week Hours
<asp:TextBox id=hours Columns="1" runat=server/><br>
<asp:RequiredFieldValidator id="RequiredFieldValidatorHours" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Hours">
</asp:RequiredFieldValidator>
<font face="Verdana" Size="2">Days  <Asp:TextBox id=Days columns="1" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorDays" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Days">
</asp:RequiredFieldValidator>
<tr><td colspan="3" bgcolor="MAROON" align="center"> <font face="Verdana" Size="2" COLOR="WHITE"><b> INJURY OR ILLNESS</b></td></tr>
</td></tr> <tr><td colspan="3"><font face="Verdana" Size="2"> Which part of the Body Was Injured? (If leg, hand or arm, specify left or right. If finger, specify which)
<asp:textbox id="part" columns = "40" runat = server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorPart" Display=Dynamic runat="server"
Text="This field required" ControlToValidate="Part">
</asp:RequiredFieldValidator>
</td></tr> <tr><td colspan="3">
<font face="Verdana" Size="2"> What was the Nature of the Injury? - Choose one
<asp:DropDownList id="nature" runat=server>
<asp:ListItem Text="Choose One"/>
<asp:ListItem Text="Abdominal Strain"/>
<asp:ListItem Text="Ankle Sprain"/>
<asp:ListItem Text="Back Strain"/>
<asp:ListItem Text="Arm Strain"/>
<asp:ListItem Text="Contusion"/>
<asp:ListItem Text="Embedded Foreign Object"/>
<asp:ListItem Text="Foot Fracture"/>
<asp:ListItem Text="Foreign substance in eye"/>
<asp:ListItem Text="Hand/Finger Fracture"/>
<asp:ListItem Text="Hand/Finger Smash"/>
<asp:ListItem Text="Laceration"/>
<asp:ListItem Text="Leg Fracture"/>
<asp:ListItem Text="Neck Strain"/>
<asp:ListItem Text="Puncture Wound"/>
<asp:ListItem Text="Repetitive Motion Injury"/>
<asp:ListItem Text="Shoulder Strain"/>
<asp:ListItem Text="Struck By Lumber"/>
<asp:ListItem Text="Torn Tendon"/>
<asp:ListItem Text="Other"/>
</asp:DropDownList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorNature" runat="server"
Text="You must answer this question" ControlToValidate="nature">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="3" valign="center">
<font face="Verdana" Size="2"> Injury/Illness Description:
<asp:textbox TextMode="MultiLine" Rows="2" columns= "65" id="Description" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorDescrip" runat="server"
Text="You must answer this question" ControlToValidate="Description">
</asp:RequiredFieldValidator>
</td></tr><tr><td><font face="Verdana" Size="2"> Initial Medical Treatment:
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=Initial runat="server">
<asp:ListItem>ER Treated & Released</asp:ListItem>
<asp:ListItem>Hospitalized less than 24 hours</asp:ListItem>
<asp:ListItem>Hospitalized more than 24 hours</asp:ListItem>
<asp:ListItem>Physician/Clinic</asp:ListItem>
<asp:ListItem>Minor/Onsite</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorInitial" runat="server"
Text="You must answer this question" ControlToValidate="Initial">
</asp:RequiredFieldValidator>
</td><td colspan="2" valign="top"><font face="Verdana" Size="2"> What Type of Medical Provider Performed Treatment?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=Provider runat="server">
<asp:ListItem>Hospital</asp:ListItem>
<asp:ListItem>Clinic</asp:ListItem>
<asp:ListItem>Physician</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorProvider" runat="server"
Text="You must answer this question" ControlToValidate="Provider">
</asp:RequiredFieldValidator>
<br>
<font face="Verdana" Size="2"> Was Employee admitted into a Hospital?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=Admitted runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorAdmitted" runat="server"
Text="You must answer this question" ControlToValidate="Admitted">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="3"><font face="Verdana" Size="2">Medical Provider - Name:
<asp:TextBox Columns = "65" id=ProviderName runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorProviderName" runat="server"
Text="You must answer this question" ControlToValidate="ProviderName">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="3"><font face="Verdana" Size="2">Medical Provider - Address:
<asp:TextBox Columns = "65" id=ProviderStreet runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorProviderStreet" runat="server"
Text="You must answer this question" ControlToValidate="ProviderStreet">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="3"><font face="Verdana" Size="2">Medical Provider - City State Zip:
<asp:TextBox Columns = "65" id=ProviderCity runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorProviderCity" runat="server"
Text="You must answer this question" ControlToValidate="ProviderCity">
</asp:RequiredFieldValidator>
</td></tr><tr><td colspan="3"><font face="Verdana" Size="2">Medical Provider - Phone:
<asp:TextBox id=ProviderPhone runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorProviderPhone" runat="server"
Text="You must answer this question" ControlToValidate="ProviderPhone">
</asp:RequiredFieldValidator>
</td></tr>
<tr><td colspan="3" bgcolor="MAROON" align="center"> <font face="Verdana" Size="2" COLOR="WHITE"><strong>ACCIDENT DETAILS</strong></td></tr>
</td></tr>
<tr><td colspan="3"> <font face="Verdana" Size="2"> Give a Full Description of the Accident:<font Size="1"> (Be as Complete as Possible)
<asp:TextBox TextMode="MultiLine" Rows="5" columns= "85" id=Full runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorFull" runat="server"
Text="You must answer this question" ControlToValidate="Full">
</asp:RequiredFieldValidator>
</td></tr> <tr><td colspan="3"><font face="Verdana" Size="2"> What Caused the Injury?
<asp:TextBox id= caused columns="85" runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorCaused" runat="server"
Text="You must answer this question" ControlToValidate="Caused">
</asp:RequiredFieldValidator>
</td></tr> <tr><td><font face="Verdana" Size="2">Did the Accident Occur at the Store or Plant?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=Occur runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorOccur" runat="server"
Text="You must answer this question" ControlToValidate="Occur">
</asp:RequiredFieldValidator>
</td><td colspan="2" valign="top"> <font face="Verdana" Size="2"> If No, where did the accident occur?
<asp:textBox Columns = "40" id=where runat=server/>
</td></tr> <tr><td><font face="Verdana" Size="2"> Accident Address:
<font face="Verdana" Size="2"> <br> Street <asp:TextBox columns="45" id=accidentStreet runat=server/>
<br><asp:RequiredFieldValidator id="RequiredFieldValidatorAccidentStreet" Display=Dynamic runat="server"
Text="Fill this in" ControlToValidate="AccidentStreet">
</asp:RequiredFieldValidator>
</td><td><font face="Verdana" Size="2"> City                            State <br><asp:TextBox columns="20" id = AccidentCity runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorAccidentCity" display=dynamic runat="server"
Text="Fill in this field" ControlToValidate="AccidentCity">
</asp:RequiredFieldValidator>
<font face="Verdana" Size="2"> <asp:TextBox columns="2" id=AccidentState runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorAccidentState" Display=Dynamic runat="server"
Text="You must fill in this field" ControlToValidate="AccidentState">
</asp:RequiredFieldValidator>
</td><td>
<font face="Verdana" Size="2">Zip <br><asp:TextBox columns = "10" id=AccidentZip runat=server/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorAccidentZip" Display=Dynamic runat="server"
Text="You must fill in this field" ControlToValidate="AccidentZip">
</asp:RequiredFieldValidator>
</td></tr> <tr><td valign="top"><font face="Verdana" Size="2"> Are Other WC Claims Involved?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=OtherClaims RepeatDirection="Horizontal" Display=dynamic runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorOtherClaims" runat="server"
Text="Required" ControlToValidate="OtherClaims">
</asp:RequiredFieldValidator>
</td><td Valign="top"><font face="Verdana" Size="2"> Safety Devices Provided?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=SafetyDevices RepeatDirection="horizontal" Display=dynamic runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorSafetyDevices" Display=dynamic runat="server"
Text="Required" ControlToValidate="SafetyDevices">
</asp:RequiredFieldValidator>
</td><td><font face="Verdana" Size="2"> Safety Devices Utilized?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=DevicesUtilized RepeatDirection="Horizontal" runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorDevicesUtilized" Display=dynamic runat="server"
Text="Required" ControlToValidate="DevicesUtilized">
</asp:RequiredFieldValidator>
</td></tr><tr><td><font face="Verdana" Size="2"> Was There a Witness?
<asp:RadioButtonList font-name="verdana" font-size="10 pt" id=Witness RepeatDirection="Horizontal" Display=dynamic runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorWitness" runat="server"
Text="You must answer this question" ControlToValidate="Witness">
</asp:RequiredFieldValidator>
</td><td valign = "top"><font face="Verdana" Size="2">
If Yes, List Name: <asp:Textbox id="WitnessName" columns="40" runat=server/>
</td></tr>
<tr><td colspan="3" bgcolor="MAROON" align="center">
<font face="Verdana" Size="2" COLOR="WHITE"><strong>DISABILITY STATUS</strong></td></tr>
</td><td colspan="3"><font face="Verdana" Size="2"> Did Employee Receive Pay for Date of Injury?
<asp:RadioButtonList RepeatDirection="Horizontal" font-name="verdana" font-size="10 pt" id=ReceivePay runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidatorReceivePay" runat="server"
Text="You must answer this question" ControlToValidate="ReceivePay">
</asp:RequiredFieldValidator>
</td></tr>
<tr><td colspan="3" bgcolor="MAROON" align="center">
<font face="Verdana" Size="2" COLOR="WHITE"><strong>ADDITIONAL COMMENTS & INFORMATION</strong></td></tr>
<tr><td colspan="3"><font face="Verdana" Size="2"> Additional Comments
<asp:textbox TextMode= "Multiline" Rows= "5" columns= "80"
id="comments" runat=server width="730" height="40"/>
</td></tr>
<tr><td colspan="3"><font face="Verdana" Size="2">How can the above incident be prevented from happening again?
<asp:textbox id=Prevented Textmode="Multiline" Rows = "3" Columns="80" width="730" runat=server/>
<tr><td><font face="Verdana" Size="2"><br> Name of person submitting this form:
<asp:textbox id="Submitter" valign="top" runat=server columns="40"/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorSubmit" runat="server"
Text="You must enter name" ControlToValidate="Submitter">
</asp:RequiredFieldValidator>
<font face="Verdana" Size="2"><br>Title: <asp:textbox id="Title" valign="top" runat=server columns="40"/>
</td><td> <font face="Verdana" Size="2"> Wheeler's Division - Choose One <Asp:DropDownList id=Location runat=server>
<asp:ListItem Text="Choose One"/>
<asp:ListItem Text="Riverside Truss Plant"/>
<asp:ListItem Text="Riverside Door Plant"/>
<asp:ListItem Text="Riverside Office"/>
<asp:ListItem Text="Rome Store"/>
<asp:ListItem Text="Calhoun Store"/>
<asp:ListItem Text="Dalton Store"/>
<asp:ListItem Text="Austell Store"/>
<asp:ListItem Text="Morrow Store"/>
<asp:ListItem Text="Installed Sales"/>
<asp:ListItem Text="Newnan Store"/>
<asp:ListItem Text="Cartersville Store"/>
<asp:ListItem Text="Winder Store"/>
<asp:ListItem Text="Jasper Store"/>
<asp:ListItem Text="Chelsea Store"/>
<asp:ListItem Text="Madison Store"/>
<asp:ListItem Text="Peterson Products"/>
<asp:ListItem Text="Lawrenceville"/>
<asp:ListItem Text="OAR Window Shop"/>
<asp:ListItem Text="Charlotte - Hoskins Rd"/>
<asp:ListItem Text="Charlotte - Westinghouse Blvd"/>
<asp:ListItem Text="Sales Support Center"/>
<asp:ListItem Text="Land Development"/>
</asp:DropDownList>
</td><td><br>
<font face="Verdana" Size="2">Date<br><asp:textbox id="Today" runat=server columns="10"/>
<asp:RequiredFieldValidator id="RequiredFieldValidatorToday" runat="server"
Text="You must enter today's date" ControlToValidate="Today">
</asp:RequiredFieldValidator>
</Table>
<tr>
<td>
<asp:Button id="btnSendMail" text="Submit" OnClick="SendMailandDatabase" runat="server" />
</td>
</tr>
<td valign=top> <table cellpadding=20><tr><td>
<asp:ValidationSummary ID="valSum" runat="server" ShowMessageBox="true" ShowSummary="false" HeaderText="You must enter more information" Font-Name="verdana" Font-Size="12" /> </td>
</form>
</body>
</html>
Mark Rae [MVP] - 27 Sep 2007 16:30 GMT > Dim strConn As String = ("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & > Server.Mappath("~\Acc.mdb") & ";") Er... surely not!!!!!
http://www.wheelers.com/Acc.mdb
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Göran Andersson - 26 Sep 2007 22:37 GMT > I haven't given up yet, but I'm wondering if OOP is worth the effort. Absolutely.
> I know that almost everybody in this forum thinks OOP is the only way to go, > but is there anybody out there who believes differently? > 1. Is there anybody who believes that programming patterns will change in > the near future and leave OOP behind? No, not for many years. OOP has been widely used for about 20 years, and I wouldn't be the least bit surprised if it will be around for another 20.
Even if something new and revolutionary comes up tomorrow, it will be several years until it's even developed into something commercially useful.
> 2. I *love* Asp.net. Is there any language to use presently in ASP.net > that uses the TRADITIONAL method of programming? Not really. There are some procedural languages, but they still all work with the .NET framework, which is object oriented.
> 3. I chose VB.Net to learn because it looked similar to other vb I had used > on occasion. On first blush it seemed LOGICAL, as other programming [quoted text clipped - 3 lines] > Is it possible to program with VB.net using traditional logic, without the > OOP? (**Using it only for web applications**) VB.NET is an object oriented language, so you can't use it completely without object orientation. You can get by without using much of the OOP features in your code, but everything that you use in the framework is still object oriented.
> 4. If number 3 is true, who can tell me how to get help without somebody > insisting on OOP? > > 5. Do I need to be in a different forum? If so, Where? Rather using a completely different system... ASP.NET without OOP is a little like driving a Ferrari and refusing to use anything but the first gear.
 Signature Göran Andersson _____ http://www.guffa.com
Mark Rae [MVP] - 26 Sep 2007 23:06 GMT > I haven't given up yet, but I'm wondering if OOP is worth the effort. Depends how serious you are about being a .NET developer...
> I know that almost everybody in this forum thinks OOP is the only way to > go, but is there anybody out there who believes differently? It's not the only way to go, but it's by far the most efficient. Next time you have to drive anywhere, try doing it in reverse gear - you'll still get there next week... Of course, by the time you get there, everyone else will already have gone...
> 1. Is there anybody who believes that programming patterns will change in > the near future and leave OOP behind? Not me.
> 2. I *love* Asp.net. Is there any language to use presently in ASP.net > that uses the TRADITIONAL method of programming? All .NET languages program against the .NET Framework, otherwise they wouldn't be .NET languages. The .NET Framework is object-orientated - ipso facto...
> 3. I chose VB.Net to learn because it looked similar to other vb I had > used on occasion. Possibly the worst reason you could have had for choosing VB.NET, IMO... Other than some syntactical similarities, VB.NET bears absolutely no relationship whatsoever to any flavour of Basic...
> On first blush it seemed LOGICAL, as other programming languages I had > used in the past. And it is....... until I am told my code is all > wrong because it doesn't use the oop processes. If by 'wrong' you mean 'highly inefficient', then I would agree with whoever told you that...
> Is it possible to program with VB.net using traditional logic, without the > OOP? (**Using it only for web applications**) Virtually everything you have written so far in VB.NET uses object oientation to some degree...
> 5. Do I need to be in a different forum? No, you need a different development environment. Try PHP...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Chris Fulstow - 27 Sep 2007 01:13 GMT > I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to go, > but is there anybody out there who believes differently? > 1. Is there anybody who believes that programming patterns will change in > the near future and leave OOP behind? OOP is probably here to stay, at least for a while, because it's so popular. It's worth the effort because when it's used right it works fantastically. The problem is that many developers don't quite get what OOP is about, and create vast unmaintainable class hierarchies with too many dependencies.
Microsoft has developed a research language called F# which is dubbed "pragmatically-orientented", it has elements of object-oriented, functional and procedural languages. Maybe an indication of things to come and a shift away from OOP. http://research.microsoft.com/fsharp/fsharp.aspx
> 2. I *love* Asp.net. Is there any language to use presently in ASP.net > that uses the TRADITIONAL method of programming? If by traditional you mean procedural/imperative like C, Pascal, Perl or PHP then you can use VB.NET or C# in a fairly similar fashion, without bothering too much with OOP constructs like inheritance, classes, abstraction, polymorphism etc. You could just put all your functions in modules or static/shared classes. You'll still be using lots of objects from the .NET Framework, but you can keep the design of your application more "traditional". Although OOP zealots would sneer at this, a well written procedural application is sometimes better than a bad OOP one. However, OOP is definitely worth the effort when you do it right.
Chris
clintonG - 27 Sep 2007 01:21 GMT The principles of OOP will persist forever and are invaluable. The implementation of all modern programming lanaguges is becoming more and more declarative OOP principles not withstanding.. I have this nagging insight that you may be selling used cars someday.
Ans I also think its awfully presumptuous of you to use a phoney email handle with a microsoft top level domain when dancer@shitforbrains.com would work just as well. At least the spambots go nowhere because they can't ping Microsoft's DNS servers.
<%= Clinton Gallagher URL http://clintongallagher.metromilwaukee.com/
>I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to [quoted text clipped - 17 lines] > > 5. Do I need to be in a different forum? If so, Where? darrel - 27 Sep 2007 14:58 GMT > Ans I also think its awfully presumptuous of you to use a phoney email > handle with a microsoft top level domain when dancer@shitforbrains.com > would work just as well. At least the spambots go nowhere because they > can't ping Microsoft's DNS servers. Good ol' Clinton. Tactful as ever. Always looking out for poor ol' Microsoft. ;o)
-Darrel
sloan - 27 Sep 2007 02:31 GMT If your software does the same thing today, and the same thing tomorrow, and the same thing 3 years from now and doesn't change/enhance over time, then sure, abandon OOP.
//
> Is it possible to program with VB.net using traditional logic, without the > OOP? (**Using it only for web applications**)// Yes it is possible. Heck, I'd say some people who think "Hey I wrote public class Employee", and sincey they're using VB.Net, they think they're using OO. Creating a bunch of concrete objects is not OO programming.
The cost of software is in the maintenance. Not necessarily the development costs. This is why IMHO, robust software (not just good, but good and robust) software is based on good OO design, and good OOP.
I'd suggest the book "Pragmatic Programmer".
I'm not saying there isn't a market for non OO code. There will be.
But I don't think OOP is going anywhere.
........
>I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to [quoted text clipped - 17 lines] > > 5. Do I need to be in a different forum? If so, Where? Nick Chan - 27 Sep 2007 05:39 GMT it is possible to use 'traditional' way in asp.net u'll have stuff like
<#include header> dim k = getConn if CheckUser() if CheckThat() bla bla <#include ../footer>
u know, very asp-like.
there are many successful sites/company which use the above method, successful I mean by easily understandable, maintain, change, upgrade, deploy, move OOP does not neccessarily mean quality
(thout i personally use 99% OOP in my asp.net projects)
> I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to go, [quoted text clipped - 17 lines] > > 5. Do I need to be in a different forum? If so, Where? Kevin Spencer - 27 Sep 2007 12:52 GMT > 1. Is there anybody who believes that programming patterns will change in > the near future and leave OOP behind? Programming patterns change all the time. However, they also remain the same all the time. There is nothing really "new" about OOP; it is simply an extension of basic first principles. Programming is the process of writing a set of instructions to a computer. The set of instructions is procedural. Do this, then this, then this, etc. However, a complete program will often contain instructions to perform a given block of instructions many times, in many places. Assembler language was the first language to combine these sets of instructions into single entities which could be re-used. Higher-level languages came about in an effort to combine these combinations, which often were used (again) repeatedly in blocks. Functions took the place of GoTo statements, to separate these blocks from the main process, thereby making the code easier to read and to edit. Arrays and structures allowed related data to be combined into aggregate entities that could be treated as a whole. OOP is simply another step towards combining data and process into aggregates which can be treated as single entities, and incorporates several other innovations (hiding information, inheritance, etc) towards the same end, which has always been making code easier to write, edit, and maintain.
Each successive technology has required a change in the way programmers think about code. Each successive technology is an abstraction of an earlier abstraction. There is always work involved in learning the new paradigm. You must either accept this or find a career that is less demanding. There is no third choice.
> 2. I *love* Asp.net. Is there any language to use presently in ASP.net > that uses the TRADITIONAL method of programming? As I've explained, there is no such thing as "traditional" programming. It changes all the time.
> 3. I chose VB.Net to learn because it looked similar to other vb I had > used on occasion. On first blush it seemed LOGICAL, as other programming > languages I had used in the past. And it is....... until I am told my > code is all wrong because it doesn't use the oop processes. The syntax is similar, requiring less of a learning curve to gain entry to the technology. However, as I said, it is necessary to understand the technology to make use of it. There is no alternative to this, other than to find another line of work. Yes, it is hard to adjust, but adjustment is part of the job of programming.
> Is it possible to program with VB.net using traditional logic, without the > OOP? (**Using it only for web applications**) What you really want to know is, is there a way to continue to be a developer without having to study all the time. The answer is "yes, but not for long." Nobody programs with machine language or assembler any more. Deprecation and obsoletion are part of the environment. Once you stop learning, you have signed the death warrant on your career. It is only a matter of time before it is executed.
 Signature HTH,
Kevin Spencer Microsoft MVP
DSI PrintManager, Miradyne Component Libraries: http://www.miradyne.net
>I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to [quoted text clipped - 17 lines] > > 5. Do I need to be in a different forum? If so, Where? tomisarobot@gmail.com - 27 Sep 2007 17:53 GMT yea, its oversold. doesn't mean its worthless or bad even. as you can see people take on the 'cold, dead hands' position, so i dont think you'll see it go away. even if those same people don't use it correctly. i kinda hate asp/c#/vb for OOP because of properties. they make it convenient and even necessary at times to write bad object code.
paraphrasing Paul Graham "OOP is a way to write maintainable spaghetti code"
he thought it was a detractor, i think thats a positive.
dancer - 27 Sep 2007 18:57 GMT What language do you use for OOP that doesn't use properties?
> yea, its oversold. doesn't mean its worthless or bad even. as you > can see people take on the 'cold, dead hands' position, so i dont [quoted text clipped - 7 lines] > > he thought it was a detractor, i think thats a positive. Ian Semmel - 27 Sep 2007 20:09 GMT OOp is an evolutionary concept which developed through necessity as programs got larger and more complicated.
The 'traditional' approach to programming, if one goes back 40 years or so, was the 'spaghetti' program, which had virtually no procedures and was full of conditionals and goto's. The terminology came about because of the lines programmers would draw on printouts as they traced the program flow.
Following this came 'structured programing' (see Yourden et al) where basically goto's were eliminated and programs were written from the top down as a series of procedure calls with 'whiles' and 'do's' etc. This was a self-imposed discipline which was not inherit in any languages (eg it was used extensively in cobol).
It was not really until the development of c++ with its ability to create objects that OOP came into its own. OOP allows the encapsulation of code to make it readily re-usable and extendable.
Now is asp.net oop ? It probably can be argued that it is at the asp server level, but I reckon that it is a bit of a dog's breakfast. You have html pages, xml in .config files, c#/vb codefiles all making contributions with the code atomised and scattered around all over the place. This is the trouble with 'drag and drop' visual designers which destroy oop for ease-of-use (imo).
> -----Original Message----- > From: dancer [mailto:dancer@microsoft.com] [quoted text clipped - 31 lines] > > 5. Do I need to be in a different forum? If so, Where? tomisarobot@gmail.com - 27 Sep 2007 20:28 GMT > OOp is an evolutionary concept which developed through necessity as > programs got larger and more complicated. is that why Design Patterns, arguably the seminal OOP design book is all 'translated' from 40yr+ old functional programming. Nothing is new, just different sheep's clothing.
> What language do you use for OOP that doesn't use properties? properties are part of the .NET framework, its not really avoidable. a property is just a getter/setter. get/set is usually bad object design. it creates a massive amount of surface area which isn't maintainable and usually breaks encapsulation.
http://www.google.com/search?q=google%20getter%20setter%20evil
Not that .NET is the only one that is guilty of this sin, its just they celebrate it.
If you stick to the basics of OOP and mind your p's and q's its a beautiful construct, but it has its limits just like any other programming practice.
John Saunders [MVP] - 27 Sep 2007 22:22 GMT >> OOp is an evolutionary concept which developed through necessity as >> programs got larger and more complicated. > > is that why Design Patterns, arguably the seminal OOP design book is > all 'translated' from 40yr+ old functional programming. Nothing is > new, just different sheep's clothing. I sort of felt the same way when I first read Design Patterns. It was as though they were saying that "all real programmers must use these design patterns". This made me ask, "so, what have _I_ been for the past 25 years?"
They also acted as though they had created these patterns, when I had been using many of them, without the fancy names, for years.
The second time I read the book, I realized that they were saying that they had studied what real developers were using, abstracted that, and then wrote that down in the book. They were actually saying that I had been a "real programmer" for years, and that they had looked over my shoulder (and many other shoulders) and wrote down what they saw.
>> What language do you use for OOP that doesn't use properties? > [quoted text clipped - 4 lines] > > http://www.google.com/search?q=google%20getter%20setter%20evil This article must be talking about the Java programming style that creates a getter and setter for every private instance variable. That _is_ a sin. The solution to not expose your implementation is - to not expose your implementation!
By replacing direct member variable references with references to a getter or setter, this "properties" pattern helps to _hide_ implementation details! The names, types, etc., of the private date can change, as long as the property signature doesn't change. You might even change the implementation to not _have_ instance variables for each property, instead delegating the property to an instance of another class. The caller will not be the wiser. This supports implementation hiding, one of the most important aspects of OO.
 Signature -------------------------------------------------------------------------------- John Saunders | MVP - Windows Server System - Connected System Developer
tomisarobot@gmail.com - 28 Sep 2007 03:22 GMT > By replacing direct member variable references with references to a getter > or setter, this "properties" pattern helps to _hide_ implementation details! my point was that a property is an implementation detail. just because the signature is consistent doesn't make it less a getter/ setter :) My personal opinion that properties are exactly the java programming style of which you speak. I didn't like it in java, I don't like it in C#.
You are quite right about not exposing it as the alternative. All the syntactic sugar in the world won't overcome the necessity of crude discipline. If thats the case though, then whats the downside of using a typeless lang :)
John Saunders [MVP] - 28 Sep 2007 04:46 GMT >> By replacing direct member variable references with references to a >> getter [quoted text clipped - 6 lines] > programming style of which you speak. I didn't like it in java, I > don't like it in C#. You're missing my point. I consider it a bad idea to create a getter/setter for every instance variable. Instead, properties should be used as part of the public contract of the class. As such, they don't necessarily have anything to do with the implementation. Just because there's a property doesn't imply that there's an instance variable behind it. You also can't assume that calling the getter does nothing more than return instance data, or that a setter only sets instance data. A getter might load data from a database if it hadn't already been loaded. A setter might set a "dirty" flag in addition to setting a backing field.
Yet the caller doesn't need to know any of that. The question of how the getter and setter are implemented is an implementation detail. The fact that the getter gets something (and presumably has no visible side effects) or that the setter sets something (presumably such that the getter would subsequently return that same value) is all that the client needs to know.
That's encapsulation, not an implementation detail.
 Signature -------------------------------------------------------------------------------- John Saunders | MVP - Windows Server System - Connected System Developer
Shelly - 28 Sep 2007 15:50 GMT >>> By replacing direct member variable references with references to a >>> getter [quoted text clipped - 25 lines] > > That's encapsulation, not an implementation detail. Very well said!
Shelly
George Ter-Saakov - 27 Sep 2007 21:29 GMT Answers (my opinion).
1. it might change but I do not see how at the present. so nothing in a near future.
2. Why? The whole point to switching to ASP.NET is to use OOP. Which is kind of called "traditional" for me for 10 years now.
3. You just make your life harder but not using OOP. You can as well start programming using asm (assembler language). Do not expect find any followers. PS: Do yourself a favor. switch to C#. While languages are 100% identical in "abilities" the VB compiler still oriented for novices and decides a lot of thing for you which leads to unexpected behavior in big projects.
4. Did not understand a question. Actually I fail to understand how you using ASP.NET without OOP.
George
>I haven't given up yet, but I'm wondering if OOP is worth the effort. > I know that almost everybody in this forum thinks OOP is the only way to [quoted text clipped - 17 lines] > > 5. Do I need to be in a different forum? If so, Where?
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|