Advertisement

07.17.2008 at 07:33PM PDT, ID: 23575633
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

Reverse engineer asp file to recreate lost files

Asked by timshows in Active Server Pages (ASP), Programming for ASP.NET

Tags:

A client's webserver crashed resulting in some lost asp files. The lost files are similar to ones still in place so if someone could explain to me the logic of how these files work, maybe I can recreate the lost ones. This is probably a basic question, but normally I only work in Coldfusion, so I could use a quick tutorial on this specific topic/configuration.

In the below file, why are there asp files stored in a classes directory? Was the file cRestaurant.asp created by hand or some prgramming tool that I can use to recreate my missing files?

I also noticed that in the .mdb file that contains the data, that there are queries that are stored there, I'm guessing I will need to figure out which queries need to be recreated, since the asp reference them?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
726:
727:
728:
729:
730:
731:
732:
733:
734:
735:
736:
737:
738:
739:
740:
741:
742:
restaurantDetail.asp file (condensed version):
 
<!-- #include file="classes/cRestaurant.asp" -->
<!-- #include file="classes/cRestaurantList.asp" -->
<!-- #include file="classes/cImage.asp" -->
<!-- #include file="classes/cImageList.asp" -->
<!-- #include file="classes/cMenu.asp" -->
<!-- #include file="classes/cMenuList.asp" -->
<!-- #include file="classes/cReview.asp" -->
<!-- #include file="classes/cReviewList.asp" -->
 
<%
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=-=- Start Subroutines and Functions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sub ResultsForm		
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
    	<td><div style="padding-bottom:10px"><img src="images/sp_904_banner.jpg" width="630" height="100" /></div></td>
  	</tr>
	</table>
	
	<table width="100%" border="0">
	<tr><td><h2><%=myRestaurant.Name%></h2></td></tr>
	</table>
		
	<table width="100%" border="0">
		<tr>
		<%
		Dim myList
		Set myList = New cImageList
		Call myList.GetRecordsByIDandType(recordID, "R")
		for each myImage in myList.Images.Items %>
			<td align="center"><div style="text-align:center;"><img src="includes/displayImage.asp?id=<%=myImage.ID%>" border="0" class="details"></div></td>
		<%	set myImage = nothing
		next %>
		</tr>
	</table>
	<br>
	<table width="96%" border="0" align="center">
		<tr><td colspan="2"><%=Replace(myRestaurant.Intro, vbcrlf, "<br>")%></td>
		  </tr>
		<tr><td colspan="2">&nbsp;</td>
		  </tr>
		<tr><td width="50%">Price: <font color="#006600"><%=myRestaurant.Price%></font><br>	
		<%
		tempCuisineString = ""
		tempCuisineString = myRestaurant.CuisineName
		If myRestaurant.CuisineName2 <> "" Then
			tempCuisineString = tempCuisineString & ", " & myRestaurant.CuisineName2
		End If
		If myRestaurant.CuisineName3 <> "" Then
			tempCuisineString = tempCuisineString & ", " & myRestaurant.CuisineName3
		End If
		If myRestaurant.CuisineName4 <> "" Then
			tempCuisineString = tempCuisineString & ", " & myRestaurant.CuisineName4
		End If
		If myRestaurant.CuisineName5 <> "" Then
			tempCuisineString = tempCuisineString & ", " & myRestaurant.CuisineName5
		End If		
		%>		
		Cuisine: <%=tempCuisineString%><br>
		Address: <%=myRestaurant.Address%>&nbsp;(<%=myRestaurant.LocationName%>)<br>
		Phone: <%=myRestaurant.Contact%><br>
		<%
		If myRestaurant.Email <> "" Then
			Response.Write("Email: <a href='mailto:" & myRestaurant.Email & "'>" & myRestaurant.Email & "</a><br>")
		End If
		If myRestaurant.URL <> "" Then
			Response.Write("Website: <a target='_blank' href='http://" & myRestaurant.URL & "'>" & myRestaurant.URL & "</a><br>")
		End If
		%>	
		Attire: <%=myRestaurant.Attire%><br>
		<% 
		tempItems = ""
		If myRestaurant.Hours <> "" 		Then tempItems = tempItems & "Open Hours: " & myRestaurant.Hours & ", " End If
		If myRestaurant.Alcohol <> "" 		Then tempItems = tempItems & myRestaurant.Alcohol & ", " End If
		If myRestaurant.Reservations = true Then tempItems = tempItems & " Reservations Available, " End If
		If myRestaurant.Breakfast = true 	Then tempItems = tempItems & " Breakfast, " End If
		If myRestaurant.Lunch = true 		Then tempItems = tempItems & " Lunch, " End If
		If myRestaurant.Dinner = true 		Then tempItems = tempItems & " Dinner, " End If
		If myRestaurant.SaladBar = true 	Then tempItems = tempItems & " SaladBar, " End If
		If tempItems <> "" Then
			tempItems = left(tempItems, len(tempItems)-2)
		End If
		Response.Write(tempItems)
		%>		
		</td>
		  <td width="50%" rowspan="4"><%=myRestaurant.MapURL%></td>
		</tr>
		
		<tr><td><br>		  &nbsp;</td>
		  </tr>
		<tr><td><br><%
			Set myList = New cMenuList
			Call myList.GetRecordsByIDandTypeAndDocumentType(recordID, "R", "Menu")
			If myList.RowsCount > 0 Then
				%><img src="images/icon_from_hp_dining.jpg"><%
				For each myMenu in myList.Menus.Items
				%>
					<a href="includes/displayMenu.asp?id=<%=myMenu.ID%>" target="_blank">
					<% If myMenu.DisplayName <> "" Then
						Response.Write(myMenu.DisplayName)
						Else
						Response.Write(left(myMenu.Filename,len(myMenu.Filename)-4))
						End If
					%></a><br>
					<%
					set myMenu = nothing
				next 
			End If 
			
			Response.Write("<br><br>")
			
			Set myList = New cMenuList
			Call myList.GetRecordsByIDandTypeAndDocumentType(recordID, "R", "Coupon")
			If myList.RowsCount > 0 Then
				%><img src="images/icon_from_hp_coupon.jpg"><%
				For each myMenu in myList.Menus.Items
				%>
					<a href="includes/displayMenu.asp?id=<%=myMenu.ID%>" target="_blank">
					<% If myMenu.DisplayName <> "" Then
						Response.Write(myMenu.DisplayName)
						Else
						Response.Write(left(myMenu.Filename,len(myMenu.Filename)-4))
						End If
					%></a><br>
					<%
					set myMenu = nothing
				next 
			End If	
			
			Response.Write("<br><br>")
			
			Set myList = New cMenuList
			Call myList.GetRecordsByIDandTypeAndDocumentType(recordID, "R", "Brochure")
			If myList.RowsCount > 0 Then
				%><img src="images/icon_from_hp_brochure.jpg"><%
				For each myMenu in myList.Menus.Items
				%>
					<a href="includes/displayMenu.asp?id=<%=myMenu.ID%>" target="_blank">
					<% If myMenu.DisplayName <> "" Then
						Response.Write(myMenu.DisplayName)
						Else
						Response.Write(left(myMenu.Filename,len(myMenu.Filename)-4))
						End If
					%></a><br>
					<%
					set myMenu = nothing
				next 
			End If			
			%>&nbsp;</td>
		  </tr>
		<tr>
        	<td><br>
			<% If Request.QueryString("cmd") = "Return" Then %>
				<a href="javascript:history.go(-3)">Return to List</a>
			<% Else %>
				<a href="javascript:history.go(-1)">Return to List</a>
			<% End If %>
			</td>
        </tr>		
	</table>
	<br>
	<% If myRestaurant.Email <> "" Then 
			emailToFieldInTheForm = ""
			emailToFieldInTheForm = myRestaurant.Email %>
			&nbsp;&nbsp;<b>Send a quick message to <%=myRestaurant.Name%></b>
			<!-- #include file="includes/contactForm.htm" -->				
	<% End If %>
	<br>
	<br>
	<br>
	<%
	Set myReviewList = New cReviewList
	Call myReviewList.GetApprovedRecordsByRecordIDandType(recordID, "R")
	If myReviewList.RowsCount > 0 Then
	%>
		&nbsp;&nbsp;<b>Reviews For <%=myRestaurant.Name%></b>
		<br><br>
		<table width="98%" border="0" align="center" cellpadding="5" cellspacing="5">
	<%
		For each myReview in myReviewList.Reviews.Items
			Response.Write("<td bgcolor='#9AD6EE' class='category_box_text' width='100%'>")
			Response.Write(myReview.Rating & " - ")
			Response.Write(myReview.CreatedDate & " - ")
			Response.Write(Replace(myReview.Comments,vbcrlf,"<br>") & "</td></tr>")
			set myReview = nothing
		next
	%>
		</table><br><br>
	<%
	Else
		Response.Write("No Reviews For " & myRestaurant.Name & "<br><br>") 
	End If
	
	RecordIDInTheForm = recordID
	RecordTypeInTheForm = "R"
	CompanyNameInTheForm = myRestaurant.Name
	ReturnURLInTheForm = "restaurantDetail.asp"
%>
	&nbsp;&nbsp;<b>Submit a Review for <%=myRestaurant.Name%></b>
	<br><br>
	<!-- #include file="includes/reviewForm.htm" -->
<%	   
End Sub
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=-=- End Subroutines and Functions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%>
 
cRestaraunt.asp file:
 
<%
Class cRestaurant
 
Private m_ID			'number
Private m_Name
Private m_Cuisine		'number
Private m_Location		'number
Private m_Intro
Private m_Contact
Private m_MapURL
Private m_Attire
Private m_Hours
Private m_Alcohol
Private m_Reservations	'bool
Private m_SaladBar		'bool
Private m_Breakfast		'bool
Private m_Lunch			'bool
Private m_Dinner		'bool
Private m_CreatedDate	'date/time
Private m_CreatedBy
Private m_LastUpdated	'date/time
Private m_UpdatedBy
Private m_Price
Private m_Address
Private m_AdLevel
Private m_URL
Private m_Email
Private m_Priority
Private m_Cuisine2
Private m_Cuisine3
Private m_Cuisine4
Private m_Cuisine5
 
Private m_CuisineName
Private m_LocationName
Private m_CuisineName2
Private m_CuisineName3
Private m_CuisineName4
Private m_CuisineName5
 
Private m_LastError
Private m_RowsCount
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get LastError()
    LastError = m_LastError
End Property
 
Public Property Let LastError(value)
    m_LastError = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get RowsCount()
    RowsCount = m_RowsCount
End Property
 
Public Property Let RowsCount(value)
    m_RowsCount = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get ID()
    ID = clng(m_ID)
End Property
 
Public Property Let ID(value)
    m_ID = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Name()
    Name = m_Name
End Property
 
Public Property Let Name(value)
    m_Name = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Cuisine()
    Cuisine = clng(m_Cuisine)
End Property
 
Public Property Let Cuisine(value)
    m_Cuisine = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Location()
    Location = clng(m_Location)
End Property
 
Public Property Let Location(value)
    m_Location = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Intro()
    Intro = m_Intro
End Property
 
Public Property Let Intro(value)
    m_Intro = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Contact()
    Contact = m_Contact
End Property
 
Public Property Let Contact(value)
    m_Contact = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get MapURL()
    MapURL = m_MapURL
End Property
 
Public Property Let MapURL(value)
    m_MapURL = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Attire()
    Attire = m_Attire
End Property
 
Public Property Let Attire(value)
    m_Attire = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Hours()
    Hours = m_Hours
End Property
 
Public Property Let Hours(value)
    m_Hours = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Alcohol()
    Alcohol = m_Alcohol
End Property
 
Public Property Let Alcohol(value)
    m_Alcohol = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Reservations()
    Reservations = m_Reservations
End Property
 
Public Property Let Reservations(value)
    m_Reservations = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get SaladBar()
    SaladBar = m_SaladBar
End Property
 
Public Property Let SaladBar(value)
    m_SaladBar = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Breakfast()
    Breakfast = m_Breakfast
End Property
 
Public Property Let Breakfast(value)
    m_Breakfast = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Lunch()
    Lunch = m_Lunch
End Property
 
Public Property Let Lunch(value)
    m_Lunch = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Dinner()
    Dinner = m_Dinner
End Property
 
Public Property Let Dinner(value)
    m_Dinner = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CreatedDate()
    CreatedDate = m_CreatedDate
End Property
 
Public Property Let CreatedDate(value)
    m_CreatedDate = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CreatedBy()
    CreatedBy = m_CreatedBy
End Property
 
Public Property Let CreatedBy(value)
    m_CreatedBy = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get LastUpdated()
    LastUpdated = m_LastUpdated
End Property
 
Public Property Let LastUpdated(value)
    m_LastUpdated = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get UpdatedBy()
    UpdatedBy = m_UpdatedBy
End Property
 
Public Property Let UpdatedBy(value)
    m_UpdatedBy = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Price()
    Price = m_Price
End Property
 
Public Property Let Price(value)
    m_Price = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Address()
    Address = m_Address
End Property
 
Public Property Let Address(value)
    m_Address = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get AdLevel()
   If m_AdLevel <> "" Then    
    	AdLevel = CLng(m_AdLevel)
   End If
End Property
 
Public Property Let AdLevel(value)
    m_AdLevel = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get URL()
    URL = m_URL
End Property
 
Public Property Let URL(value)
    m_URL = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Email()
    Email = m_Email
End Property
 
Public Property Let Email(value)
    m_Email = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Priority()
    Priority = m_Priority
End Property
 
Public Property Let Priority(value)
    m_Priority = value
End Property
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Cuisine2()
	If m_Cuisine2 <> "" Then
    	Cuisine2 = clng(m_Cuisine2)
	End If
End Property
 
Public Property Let Cuisine2(value)
    m_Cuisine2 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Cuisine3()
	If m_Cuisine3 <> "" Then
    	Cuisine3 = clng(m_Cuisine3)
	End If
End Property
 
Public Property Let Cuisine3(value)
    m_Cuisine3 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Cuisine4()
	If m_Cuisine4 <> "" Then
    	Cuisine4 = clng(m_Cuisine4)
	End If
End Property
 
Public Property Let Cuisine4(value)
    m_Cuisine4 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get Cuisine5()
	If m_Cuisine5 <> "" Then
    	Cuisine5 = clng(m_Cuisine5)
	End If
End Property
 
Public Property Let Cuisine5(value)
    m_Cuisine5 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CuisineName()
    CuisineName = m_CuisineName
End Property
 
Public Property Let CuisineName(value)
    m_CuisineName = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get LocationName()
    LocationName = m_LocationName
End Property
 
Public Property Let LocationName(value)
    m_LocationName = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CuisineName2()
    CuisineName2 = m_CuisineName2
End Property
 
Public Property Let CuisineName2(value)
    m_CuisineName2 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CuisineName3()
    CuisineName3 = m_CuisineName3
End Property
 
Public Property Let CuisineName3(value)
    m_CuisineName3 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CuisineName4()
    CuisineName4 = m_CuisineName4
End Property
 
Public Property Let CuisineName4(value)
    m_CuisineName4 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Property Get CuisineName5()
    CuisineName5 = m_CuisineName5
End Property
 
Public Property Let CuisineName5(value)
    m_CuisineName5 = value
End Property 
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Function LoadThisRecordID(strID)
	Dim strSQL
    'strSQL = "EXEC GetRestaurantByID " & CLng(strID) 
	
	strSQL = "SELECT Restaurant.ID, Restaurant.Name, Restaurant.Cuisine, Restaurant.Location, " & _
		"Restaurant.Intro, Restaurant.Contact, Restaurant.MapURL, Restaurant.Attire, " & _
		"Restaurant.Hours, Restaurant.Alcohol, Restaurant.Reservations, Restaurant.SaladBar, " & _
		"Restaurant.Breakfast, Restaurant.Lunch, Restaurant.Dinner, Restaurant.CreatedDate, " & _
		"Restaurant.CreatedBy, Restaurant.LastUpdated, Restaurant.UpdatedBy, Restaurant.Price, " & _
		"Restaurant.Address, Restaurant.AdLevel, Restaurant.URL, Restaurant.Email, Restaurant.Priority, " & _
		"Restaurant.Cuisine2, Restaurant.Cuisine3, Restaurant.Cuisine4, Restaurant.Cuisine5, " & _
		"Locations.Location AS LocationName, A.Category AS CuisineName, " & _
		"B.Category AS CuisineName2, C.Category AS CuisineName3, " & _
		"D.Category AS CuisineName4, E.Category AS CuisineName5 " & _
		"FROM (((((Restaurant LEFT JOIN Locations ON Restaurant.Location=Locations.ID) " & _
		"LEFT JOIN Category AS A ON Restaurant.Cuisine = A.ID) " & _
		"LEFT JOIN Category AS B ON Restaurant.Cuisine2 = B.ID) " & _
		"LEFT JOIN Category AS C ON Restaurant.Cuisine3 = C.ID) " & _
		"LEFT JOIN Category AS D ON Restaurant.Cuisine4 = D.ID)" & _
		"LEFT JOIN Category AS E ON Restaurant.Cuisine5 = E.ID " & _
		"WHERE Restaurant.ID = " & CLng(strID)	
	
    LoadThisRecordID = LoadData (strSQL)
End Function
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Private Function LoadData(strSQL)
	Dim rs
    Set rs = LoadRecordSet(strSQL) 'sqlHelper
    LoadData = FillThisObjectFromRecordSet(rs)
    rs. close
    set rs = nothing
End Function
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Private Function FillThisObjectFromRecordSet(parmRS)
	Select case parmRS.recordcount
    	Case 1
        	Me.ID			= parmRS.fields("ID").Value
            Me.Name			= parmRS.fields("Name").Value
            Me.Cuisine		= parmRS.fields("Cuisine").Value
            Me.Location		= parmRS.fields("Location").Value
            Me.Intro		= parmRS.fields("Intro").Value
            Me.Contact		= parmRS.fields("Contact").Value
            Me.MapURL		= parmRS.fields("MapURL").Value
            Me.Attire		= parmRS.fields("Attire").Value
            Me.Hours		= parmRS.fields("Hours").Value
            Me.Alcohol		= parmRS.fields("Alcohol").Value
            Me.Reservations	= parmRS.fields("Reservations").Value
            Me.SaladBar		= parmRS.fields("SaladBar").Value
            Me.Breakfast	= parmRS.fields("Breakfast").Value
            Me.Lunch		= parmRS.fields("Lunch").Value
            Me.Dinner		= parmRS.fields("Dinner").Value
            Me.CreatedDate	= parmRS.fields("CreatedDate").Value
            Me.CreatedBy	= parmRS.fields("CreatedBy").Value
            Me.LastUpdated	= parmRS.fields("LastUpdated").Value
            Me.UpdatedBy	= parmRS.fields("UpdatedBy").Value
            Me.Price		= parmRS.fields("Price").Value
			Me.Address		= parmRS.fields("Address").Value
			Me.AdLevel		= parmRS.fields("AdLevel").Value
			Me.URL			= parmRS.fields("URL").Value
			Me.Email		= parmRS.fields("Email").Value
			Me.Priority		= parmRS.fields("Priority").Value
			Me.Cuisine2		= parmRS.fields("Cuisine2").Value
			Me.Cuisine3		= parmRS.fields("Cuisine3").Value
			Me.Cuisine4		= parmRS.fields("Cuisine4").Value
			Me.Cuisine5		= parmRS.fields("Cuisine5").Value
			
			Me.CuisineName		= parmRS.fields("CuisineName").Value
            Me.LocationName		= parmRS.fields("LocationName").Value
			Me.CuisineName2		= parmRS.fields("CuisineName2").Value
			Me.CuisineName3		= parmRS.fields("CuisineName3").Value
			Me.CuisineName4		= parmRS.fields("CuisineName4").Value
			Me.CuisineName5		= parmRS.fields("CuisineName5").Value
           
            FillThisObjectFromRecordSet = Me.ID
        Case -1, 0
           	m_LastError = "Invalid Restaurant Id"
        Case Else
			m_LastError = "Error: FillThisObjectFromRecordSet: Restaurant"            
        End Select
        
        m_rowsCount = parmRS.recordcount
End Function
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Function InsertRestaurant() 	'InsertRecord(tblName, strAutoFieldName, ArrFlds, ArrValues )
 
	Dim array1, array2
	array1 = Array("Name", "Cuisine", "Location", "Intro", "Contact", "MapURL", "Attire", "Hours", "Alcohol", "Reservations", "SaladBar", "Breakfast", "Lunch", "Dinner", "CreatedDate", "CreatedBy", "Price", "Address", "AdLevel", "URL", "Email", "Priority", "Cuisine2", "Cuisine3", "Cuisine4", "Cuisine5")
	array2 = Array(Me.Name, Me.Cuisine, Me.Location, Me.Intro, Me.Contact, Me.MapURL, Me.Attire, Me.Hours, Me.Alcohol, Me.Reservations, Me.SaladBar, Me.Breakfast, Me.Lunch, Me.Dinner, Me.CreatedDate, Me.CreatedBy, Me.Price, Me.Address, Me.AdLevel, Me.URL, Me.Email, Me.Priority, Me.Cuisine2, Me.Cuisine3, Me.Cuisine4, Me.Cuisine5)
	
    Me.ID = InsertRecord("Restaurant", "ID", array1, array2)
End Function
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Function UpdateRestaurant()
    Dim strSQL
    strSQL = "UPDATE Restaurant SET " & _
    "Name = '"			& SQLFilter(Me.Name)	& "', " & _
    "Cuisine = "		& CLng(Me.Cuisine)		& ",  "	& _
    "Location = "		& CLng(Me.Location)		& ",  "	& _
    "Intro = '"			& SQLFilter(Me.Intro)	& "', " & _
    "Contact = '" 		& SQLFilter(Me.Contact)	& "', " & _
    "MapURL = '" 		& SQLFilter(Me.MapURL)	& "', " & _
    "Attire = '" 		& SQLFilter(Me.Attire)	& "', " & _
    "Hours = '" 		& SQLFilter(Me.Hours)	& "', " & _
    "Alcohol = '" 		& Me.Alcohol			& "', " & _
    "Reservations = "	& CBool(Me.Reservations) & ", " & _
    "SaladBar = " 		& CBool(Me.SaladBar)	& ", " & _
    "Breakfast = " 		& CBool(Me.Breakfast)	& ", " & _
    "Lunch = " 			& CBool(Me.Lunch)		& ", " & _
    "Dinner = " 		& CBool(Me.Dinner)		& ", " & _
    "LastUpdated = '" 	& Me.LastUpdated		& "', " & _
    "UpdatedBy = '" 	& Me.UpdatedBy			& "', " & _
    "Price = '" 		& SQLFilter(Me.Price)	& "', " & _
	"Address = '" 		& SQLFilter(Me.Address)	& "', " & _
	"URL = '" 			& SQLFilter(Me.URL)		& "', " & _
	"Email = '" 		& SQLFilter(Me.Email)	& "', " & _
	"Priority = "		& CLng(Me.Priority)		& ",  "	& _
	"Cuisine2 = "		& CLng(Me.Cuisine2)		& ",  "	& _
	"Cuisine3 = "		& CLng(Me.Cuisine3)		& ",  "	& _
	"Cuisine4 = "		& CLng(Me.Cuisine4)		& ",  "	& _
	"Cuisine5 = "		& CLng(Me.Cuisine5)		& ",  "	& _
	"AdLevel = " 		& CLng(Me.AdLevel)		& " " & _   
    "WHERE ID = " & CLng(Me.ID)     
    
    UpdateOrDeleteRecord strSQL
    UpdateRestaurant =  Me.ID
End Function
 
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Public Function DeleteRestaurant()
    Dim strSQL
    strSQL = "EXEC DeleteRestaurant " & Me.ID
    UpdateOrDeleteRecord strSQL
    DeleteRestaurant =  Me.ID
End Function
 
End Class
%>
[+][-]07.17.2008 at 07:59PM PDT, ID: 22032577

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:45AM PDT, ID: 22034638

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:30AM PDT, ID: 22036877

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Programming for ASP.NET
Tags: asp
Sign Up Now!
Solution Provided By: ryancys
Participating Experts: 2
Solution Grade: B
 
 
[+][-]07.20.2008 at 07:03PM PDT, ID: 22047698

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 07:05PM PDT, ID: 22047704

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 03:15PM PDT, ID: 22054822

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628