Welcome to FoxLearn
In this video, I'll introduce you how to build a login window with user authentication in c#
This project uses Entity Framework Code First and DevExpress Component
I'll create a new sql database, then configure the system to connect to the sql database
If the system connects to the sql database successfully,
it will automatically update the encrypted sql connection into the app.config file
I will create a default account to initialize the system,
this account information is stored in the app.config file
When you sign in with this account,
you can easily initialize the UI and assign functions that correspond to the Form or UserControl you want to open.
Using the entity framework code first will help me generate tables automatically if it doesn't exist when i log into the system
I will use the tables as you are seeing to grant user permissions
The Users table is used to store user accounts
The Functions table is used to store functions
The Roles table stores the permissions group
The UserRoles table stores user accounts and permissions groups
The FunctionRoles table stores functions and permissions groups
The functions form allows you to easily create functions in the system
Each function you create will be assigned to the form or user control you want to open
You can also easily set icons and display styles for the functions you create
I will configure the system with Tab, Group, Item or Module styles
In a Tab will contain many Groups
In each Group will contain Items and in each Item can contain Module
Item is Form, and Module is UserControl
The system is designed based on Ribbon Form,
it helps you to easily layout your application features
The Roles form allows you to create permission groups
You can easily add it directly to the GridControl,
then click the save button to save your data to the sql database
The authorization form allows you to set the functions to be used for each group permission you select
The User form allows you to create user accounts, and then assign the user rights to which permission group
For each permission group, the user will be able to use the specified features
As you can see, each time you log in to your account, you will see the features that you are allowed to use
Each time you create Form or UserControl, the system will automatically add it into the form list
I will create forms and user controls, and then I will assign the corresponding functions
This is a system framework using Ribbon Form to help you easily develop your project
It supports plugins that allow you to easily integrate Form or UserControl from external libraries into the system
It also integrates report design and UI design tools
The Entities directory will contain all of my entity classes
The DataAccess directory will contain all the necessary classes to help me access the data in the sql database
I will use the Repository and UnitOfWork patterns to build the system
Repositories are classes or components that encapsulate the logic required to access data sources
They centralize common data access functionality,
providing better maintainability and decoupling the infrastructure or technology used to access databases from the domain model layer
Unit of work is a pattern to handle transaction during data manipulation using the Repository pattern
The AppSystem class helps you to initialize the system functions.
Thank you for watching this video and don't forget to subscribe to my channel