Você está na página 1de 23

POST #2:

This program create a Log in System that


loads different forms for every user type
and if the user type "admin" then the
form2 will load, then if the user type
"staff" the form3 will load
Prepared by:
Ronald D. Ayson
BSIT 3B1

Step 1. Open the Visual Studio 2010 or C# Application

Step 2. click new Project on the left side

Click

Step 3. Select Windows Forms Application

You can edit the name of the project

Click ok to move

This is the form that you can design your work


Toolbox

Solution Explorer

You can choose an item


for you work and design

Properties
You can edit the name,font,
color etc here

Step 4.Create a form like this, find it at the tool box

Label

textbox

Label

textbox

Label

Button

Button

You can edit the name of the label,button and


Textbox by selecting label, button or
Textbox and select properties

Button

Step 5. Add a windows form from your project name, right click then add,
click windows form like shown below

Step 6. Select windows form then click the button add

You can edit the name of the form

Step 7.Create a form like this, find it at the tool box

Label

Label
Button
textBox

Label

dataGridView

You can edit the name of the label,button,


dataGridView,datetimepicker and
Textbox by selecting label, button,dataGridView,
datepicker or Textbox and select properties

DateTimePicker

Button

Step: 8: Repeat adding a new form

Step 9.Create a form like this, find it at the tool box

Label

Label
Button
Label

textBox

dataGridView

You can edit the name of the label,button,


dataGridView,datetimepicker and
Textbox by selecting label, button,dataGridView,
datepicker or Textbox and select properties

DateTimePicker

Button

Step 10: Go to solution Explorer then right click REFERENCES and Add reference

Click browse then go to


C:\Program Files (x86)\MySQL\Connector NET
6.7.4\Assemblies\v4.5
If v4.5 didn't work choose v2.0 or v4.0 version
After that select the MySql.Data.dll

Click

And MySql.Data.Entity.dll

Click

Step 11. Go to Desktop and Open the MySQL Workbench application if you dont have then try to
install the installer inside the folder of Database
Then use password: admin when the installation is near to complete, after that open the MySQL
Workbench application then click or open the Local instance then type the password: admin after
that, go to management. Then select Data Import/Restore and follow theInstruction below.

Click this first

Then second
click this

Then Click and attach the


psu.sql here

Click start
import

Step 12. Go back to your C# application, double click


the FORM 1 in design.
Double click

Step : Type the codes

Step 13. Go back to your C# application, double click


the FORM 1 in design.
Double click

Step : Type the codes

Step 14. Go back to your C# application, double click


the FORM 1 in design.
Double click

Step : Type the codes

Step 15. Run the program


Type admin username and admin password

Type your name here then


click log in, it will your log in time

Type staff username and staff password

Type your name here then


click log in, it will your log in time

Reference

of the program:

Thank you

Você também pode gostar