473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Business Object Problem

----------------------------------------
..vb Code

Imports System

Namespace ValidateComponents

Dim res As Boolean
Dim strISBN as string = tbISBNNumber.text
Dim checkISBN as string
Dim Number As String
Dim CheckDigit As String
Dim CheckValue As Integer
Dim CheckSum As Integer
Dim i As Byte
Dim Cnt As Byte

res = False
CheckDigit = UCase(Right(strISBN, 1))
Number = Trim(Replace(Left(strISBN, Len(strISBN) - 1), "-", ""))
IF (Len(Number) = 9) And (InStr(1, "0123456789X", CheckDigit) > 0)
THEN
IF CheckDigit = "X" THEN
CheckSum = 10

ELSE

CheckSum = CInt(CheckDigit)

END IF

Cnt = 1
FOR i = 1 To 9
CheckSum = CheckSum + CInt(Mid(Number, i, 1)) * (11 - Cnt)
Cnt = Cnt + 1
NEXT

IF (CheckSum Mod 11 = 0) THEN res = True
END IF

checkISBN = res

END Namespace

------------------------------------------------
..aspx page CODE

Sub ValidateISBN(s as Object, e As ServerValidateEventArgs)

Dim objValidateISBN as New ValidateISBN
lblResult.text = objValidateISBN.ValidateISBN(e.value)

END Sub

Sub Button_Click(s as Object, e as EventArgs)

IF IsValid THEN lblResult.text = "a"
IF NOT IsValid THEN lblResult.text = "b"

END Sub
----------------------------------------

The problem I am having is that the text in lblResult is not b when I
input an invalid ISBN. If res = TRUE then it is valid and if res =
FALSE then the ISBN is invalid. I don't know how to pass the value of
res from the Business object to the .aspx page. I imported the same
namespace so I know that isn't the problem. Any suggestions?

Nov 19 '05 #1
3 1154
Nothing :-(

Nov 19 '05 #2
Nothing? =(

Nov 19 '05 #3
null in C#.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Sparky Arbuckle" <tw*@secureroot.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Nothing :-(

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: SteveS | last post by:
This has been bothering me for a long time, and I'm curious about everyone's opinion or a "Microsoft Best Practices" method of doing this. I have a "Member" business object which contains...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
5
by: Shibu | last post by:
Hi, I have a situation where I need to convert business objects to a flat table. The reverse is also required. I am using c# and Oracle ODP. I am looking for an easier method to do the below...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
0
by: SteveS | last post by:
I'm not sure if this is the right forum, but here it goes :-) This has been bothering me for a long time, and I'm curious about everyone's opinion or a "Microsoft Best Practices" method of doing...
3
by: Leo | last post by:
OK, this is kind of a conceptual question, so bear with me... When does a Value Object or Data Transfer Object become a Business Object, if it even does at all? For instance, in J2EE we often...
4
by: Brandon Miller | last post by:
All, I have an existing business object (VB.Net) which returns user IDs for our locations in our regions. One of the properties objReg.Manager returns the manager's user id (integer) for a given...
3
by: Aryan | last post by:
Hi, I am implementing Business object, but while implementing this I want to have DataTable or DataSet as part of Business Object. For example, I want to bind controls directly to these Business...
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
8
by: Charles Law | last post by:
This is a sort of pattern question, but relating to how components are coupled in a three-tier system. I have a presentation layer, business layer and data access layer, the first is the EXE,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.