Hey everyone,
Here is my issue and I believe it is simple but I am stuck.
I have a user login screen which is linked to the UserLogin database. There are three text boxes on the screen. One for User ID, Password, and then Security Level.
This then goes to the Main Menu of the program once it validates the login.
I have two buttons that I want to hide depending on the security level. The buttons are Customer Database and Employee Database which when clicked will allow whoever to view the two databases.
The Employee does not need to see either so the buttons should be hidden, PM should only see the Customer Database and Admin gets to see both.
How do I pull the input from the Security Level text to the Main Menu form so I can write an IF that will say if security = this then show or hide button.
Taking input and sending it to another form?
Started by Justin88, Jun 12 2010 02:56 PM
8 replies to this topic
#1
Posted 12 June 2010 - 02:56 PM
|
|
|
#2
Posted 12 June 2010 - 08:19 PM
You get security from the form right? not the database? If from the form, you can declare the string static and pass it that way:
//Login form
public static string security = "High";//Or whatever you want
//Main Form
if(LoginFormName.security = "High")
{
//Logic
}
else
{
//logic
} Hope thats what you needed. :)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#3
Posted 12 June 2010 - 09:29 PM
The security actually comes from the database. I have 3 columns. User ID, Password, and Security Level (1-3, 3 being highest).
#4
Posted 13 June 2010 - 01:40 AM
Are you using a Local Database or a Dataset along with the DataGridView?
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#5
Posted 13 June 2010 - 06:55 AM
why not use a Login control.They are made for this purpose ,u could even customize them
#6
Posted 13 June 2010 - 07:46 AM
gokuajmes said:
why not use a Login control.They are made for this purpose ,u could even customize them
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#7
Posted 13 June 2010 - 08:16 AM
Hey everyone,
Yes, I am using Windows Forms. I have used C# before but it was like two years ago so everything is taking some time coming back to me. The database is just what we decided to do and the login works and everything I just can't get the Main Menu form to hide the buttons depending on the security level that is logged in.
Yes, I am using Windows Forms. I have used C# before but it was like two years ago so everything is taking some time coming back to me. The database is just what we decided to do and the login works and everything I just can't get the Main Menu form to hide the buttons depending on the security level that is logged in.
#8
Posted 13 June 2010 - 09:36 AM
Quote
Hey everyone,
Yes, I am using Windows Forms. I have used C# before but it was like two years ago so everything is taking some time coming back to me. The database is just what we decided to do and the login works and everything I just can't get the Main Menu form to hide the buttons depending on the security level that is logged in.
Yes, I am using Windows Forms. I have used C# before but it was like two years ago so everything is taking some time coming back to me. The database is just what we decided to do and the login works and everything I just can't get the Main Menu form to hide the buttons depending on the security level that is logged in.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#9
Posted 13 June 2010 - 01:58 PM
If your looking to just transfer information between forms I did a video tutorial on it that hopefully will help you out.
How to transfer information between forms
How to transfer information between forms


Sign In
Create Account

Back to top









