I did a small sample with three tier architecture and i need to know whether the flow of the program is correct or not.The pgm works fine. Inside web.config - <configuration> <appSettings> <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/> </appSettings></configuration>
Inside Data Access Layer -
private string username;
-
private string password;
-
public string UserName
-
{
-
get { return username; }
-
set { username = value; }
-
}
-
public string PassWord
-
{
-
get { return password; }
-
set { password = value; }
-
}
-
public int checking(string username,string password)
-
{
-
int temp = 0;
-
SqlDataReader dr;
-
string con = ConfigurationManager.AppSettings["Connection"].ToString(); SqlConnection connection = new SqlConnection(con); connection.Open();
-
SqlCommand cmd = new SqlCommand("select * from pass where username='" + username + "' ", connection);
-
dr = cmd.ExecuteReader();
-
while (dr.Read())
-
{
-
string a = dr.GetValue(0).ToString();
-
string b = dr.GetValue(1).ToString();
-
if ((a.Equals(username)) && (b.Equals(password)))
-
{
-
temp= 1;
-
}
-
else
-
{
-
temp= 0;
-
}
-
}
-
return temp;
-
dr.Close();
-
connection.Close();
-
}
-
Inside Business access layer - public int checking(string username,string password)
-
{
-
Dal d = new Dal();
-
return d.checking(username,password);
-
}
Inside Presentation layer - protected void Button1_Click(object sender, EventArgs e)
-
{
-
string uname = TextBox1.Text;
-
string pwd = TextBox2.Text;
-
-
if (Convert.ToBoolean(b.checking(uname,pwd)))
-
{
-
Button1.Text = "valid";
-
}
-
else
-
{
-
Button1.Text = "Invalid";
-
}
-
-
}
I need to know whether my program flow is correct or is there any modifications need to be done.
Thanks
Regards
Raghul
3 1344 Frinavale 9,735
Recognized Expert Moderator Expert
If your program works properly then why would the flow be incorrect?
In order for your program to work properly, some steps need to be taken before other steps can be executed...if you've tested your application and have determined it to be correct then why is your process flow in question?
If you really want to check things I suggest using the Debugger tool that comes with Visual Studio to step through your application as it's running and confirm that the flow is correct.
-Frinny
Sir,
I need to know whether the people working in the CMM level 5 Companies use the same type as I did or do they follow some other guidelines in order to complete their task.
ie for example in my sample i got the username and password and i checked that in the same data access layer and then returned only the int value (0 or 1)
to the business access layer, but I need to know whether the people working in CMM level companies get those values (username and password) as parameters and send those via parameters to business layer and do the checking there and then from there return a Boolean value to presentation layer.
Thanks,
Raghul
If your program works properly then why would the flow be incorrect?
In order for your program to work properly, some steps need to be taken before other steps can be executed...if you've tested your application and have determined it to be correct then why is your process flow in question?
If you really want to check things I suggest using the Debugger tool that comes with Visual Studio to step through your application as it's running and confirm that the flow is correct.
-Frinny
Frinavale 9,735
Recognized Expert Moderator Expert
Sir,
I need to know whether the people working in the CMM level 5 Companies use the same type as I did or do they follow some other guidelines in order to complete their task.
ie for example in my sample i got the username and password and i checked that in the same data access layer and then returned only the int value (0 or 1)
to the business access layer, but I need to know whether the people working in CMM level companies get those values (username and password) as parameters and send those via parameters to business layer and do the checking there and then from there return a Boolean value to presentation layer.
Thanks,
Raghul
I know very little about the Capability Maturity Model (CMM) that you mentioned above, but from what I understand it is a Guideline to aid in the definition/understanding of an organization's processes. There are many different ways to implement a solution for a problem, the CMM guidelines help you to develop applications that are well defined, easy to understand, reliable and maintainable.
The approach that you have taken here is one that I have taken myself on many occasion but it doesn't mean that the solution is best suited for your business logic.
It is your responsibility to analyze your application and decide if it is best suited for your needs. The Capability Maturity Model is a tool to aid you in this process and I urge you to use it to create your own well defined structure for your application.
You may want to take the time to look into existing patterns and practices to help you solve your problem...but those too are just guidelines.
-Frinny
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Praasd |
last post by:
Hi
I have a problem in understanding how to implement a process created in visio through code. For example I have a diagram in visio which is defining a process, lets assume some decision boxes i.e it's just like a flow chart. I have to write a program in c# which takes this file as input and follow the flow chart instructions based on the user inputs. Are there any such samples or links that can guide me, whixh can understand the flow chart...
|
by: kiran |
last post by:
How to check whether the given application is running or not in the current
machine. From, my cshartp program I want check whether the yahoo messenger
process is running ro not..? if the process is running i want to open the
yahoo messenger application through my csharp program.. I tried using Win32
API "ShowWindow" function , but it is not opening or showing hidden
applications. How can I do this..?
|
by: Jiho Han |
last post by:
What is the best way to check whether the page is simply a postback or the
form has been submit with the intention of doing something?
In the olden days, I used to check for a form field name used for the submit
button:
<input type="submit" name="saverecord" value="push me to save">
Then I'd retrieve it using something like:
|
by: Maxim Fridental |
last post by:
It is well advertised .NET allows separate developing of web pages by a web
designer and a web programmer. Where could I find recommendations from
Microsoft about the corresponding development process or tools that really
enable such parallel development? I would also like to read some real world
experiences.
We have particularly the following problems:
1. Our web designer can't use Visual Studio, so a) all HTML code must be
copied...
|
by: D-Someone |
last post by:
I am re-posting this message as originially it did not get a single
response.. Any ideas?
--------------
I am trying to come up with a good design for a web service that has some
user logic and business processes involved. Here a small sample of the
process flow:
---
Client Get's User Input for field 1...
| |
by: Michael.Suarez |
last post by:
Suppose I have a program that prompts you with a dialogbox to enter a
password. If you get the password correct, it allows you into the
program, else it kills the program.
Suppose that when I am in Visual Studio, running the program in debug
mode, i want to bypass the password prompt because if i am the
developer, i am definately allowed to use the program.
I assumed that I could use the this.DesignMode property while in my
main...
|
by: bayer.justin |
last post by:
Hi,
I am trying to communicate with a subprocess via the subprocess
module. Consider the following example:
<subprocess.Popen object at 0x729f0>
Here hey is immediately print to stdout of my interpreter, I did not
type in the "hey". But I want to read from the output into a string,
so I do
|
by: Ros |
last post by:
There are 10 files in the folder. I wish to process all the files one
by one. But if the files are open or some processing is going on them
then I do not want to disturb that process. In that case I would
ignore processing that particular file and move to next file.
How can I check whether the file is open or not?
I tried os.stat and os.access but I am not getting the expected
results.
Also I checked in IO exceptions, IO error handler...
|
by: Marty James |
last post by:
Howdy,
I was reflecting recently on malloc.
Obviously, for tiny allocations like 20 bytes to strcpy a filename or
something, there's no point putting in a check on the return value of
malloc.
OTOH, if you're allocating a gigabyte for a large array, this might
fail, so you should definitely check for a NULL return.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |