473,396 Members | 2,098 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,396 software developers and data experts.

Check whether my Process flow is correct or not

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
Expand|Select|Wrap|Line Numbers
  1. <configuration>   <appSettings>     <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/>   </appSettings></configuration>
Inside Data Access Layer
Expand|Select|Wrap|Line Numbers
  1.  private string username; 
  2.  private string password;
  3.  public string UserName   
  4.   {  
  5.   get { return username; }  
  6.  set { username = value; }  
  7.   }  
  8.  public string PassWord 
  9.   {
  10.  get { return password; }     
  11. set { password = value; }  
  12.   }   
  13.   public int checking(string username,string password)  
  14.    {        
  15.  int temp = 0; 
  16.  SqlDataReader dr;    
  17.  string con = ConfigurationManager.AppSettings["Connection"].ToString();         SqlConnection connection = new SqlConnection(con);         connection.Open();
  18.   SqlCommand cmd = new SqlCommand("select * from pass where username='" + username + "' ", connection); 
  19.   dr = cmd.ExecuteReader(); 
  20.  while (dr.Read())  
  21.   {    
  22.  string a = dr.GetValue(0).ToString();
  23.  string b = dr.GetValue(1).ToString();   
  24.  if ((a.Equals(username)) && (b.Equals(password)))   
  25.         {
  26.             temp= 1;       
  27.         }    
  28. else      
  29.        {    
  30.             temp= 0;   
  31.          } 
  32.   }    
  33.   return temp;    
  34.  dr.Close();       
  35.  connection.Close();   
  36.   }
  37.  
Inside Business access layer

Expand|Select|Wrap|Line Numbers
  1.  public int checking(string username,string password)
  2.     {
  3.         Dal d = new Dal();
  4.         return d.checking(username,password);
  5.     }
Inside Presentation layer


Expand|Select|Wrap|Line Numbers
  1. protected void Button1_Click(object sender, EventArgs e)
  2.     {
  3.         string uname = TextBox1.Text;
  4.         string pwd = TextBox2.Text;
  5.  
  6.         if (Convert.ToBoolean(b.checking(uname,pwd)))
  7.         {
  8.             Button1.Text = "valid";
  9.         }
  10.         else
  11.         {
  12.             Button1.Text = "Invalid";
  13.         }
  14.  
  15.     }
I need to know whether my program flow is correct or is there any modifications need to be done.

Thanks

Regards
Raghul
Sep 8 '08 #1
3 1319
Frinavale
9,735 Expert Mod 8TB
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
Sep 8 '08 #2
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
Sep 10 '08 #3
Frinavale
9,735 Expert Mod 8TB
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
Sep 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
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...
1
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...
4
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...
4
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...
1
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...
9
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...
13
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...
6
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...
173
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.