Develop Commercial Automations with Entity Framework, Devexpress and C# | Project Management Tools

Devexpress and C# Develop Commercial Automations with Entity Framework 2.1

Devexpress and C# Develop Commercial Automations with Entity Framework 2.1
Devexpress and C# Develop Commercial Automations with Entity Framework 2.1


In project, we have created our own components for Object Oriented Programming, Layered Architecture, C#, Entity Framework,Long and forms. Instead of reconfiguring Visual Study’s components in the form we’ve added each time, we will create our own components and shape them as we want. You can find these components in UserControls/Controls folder in Positive software.Project.Win part of the project. We have configured 18 components according to our needs in project.

You will be able to develop your project by simply dragging and dropping these components into the forms you create. You will create new forms by creating two forms.

In this project you must have the following features and programs.*: Visual Studio, Devexpress, Sql Server installed computer Medium-level C# information Medium-level Database information Medium-level Component usage information.

Technical Information
The aim of the project is to develop commercial projects using C#, Entity Framework, Linq, Layered Architecture, Object Oriented Programming, Devexpress components.

Before running the project, make sure that you have the following requirements:

• Visual Studio 2017 Version

• Devexpress 18.1+ Version

• Sql Server 2016+ Version

The project’s contribution to you:

• Advanced level C# usage

• Add, delete, update, enrollment and ability to make registration procedures with Entity Framework.

• Ability to perform inquiry operations with Linq

• Possibility of project development by typing code according to the specific order and without code repetition

• Possibility to advanced use and develop Devexpress components.

• Possibility to create and use our own components within the Project.

• To comprehend and actively use Object Oriented Programming (OOP) logic

• To create and use a BLL ( Business Logic Layer ) layer in all projects

• To create and use a DAL ( Data Access Layer ) layer in all projects

• To create and use a Common layer in all projects

• To create and use a Data layer in all projects

• To create and use a Model layer in all projects

• To create and use a Win. Forms layer in all projects

• To create forms by deriving from 2 BaseForms in all projects

• Ability to perform new records, update and delete operations in one form

• Ability to perform single or multiple capture of all recordings

Layered Architecture
The purpose of Layers:

What is BLL layer? What does it do? : We will do register, update and delete operations in the Bll layer. We will also use the BLL layer to retrieve data to the list pages of forms. In this layer, we will send the data from the DAL layer to the UOW layer by taking the instance from the UnitOfWork layer.

In this layer, we will perform a new record, update and delete operations in a certain order. For example, we will determine only the changing fields for the update process and we will take action accordingly. We will also do the validation procedures here and when the user saves the wrong data, we will give a warning and stop the program. So the wrong data insertion process will not be done thanks to this project.

What is DAL layer, what does it do? : DAL layer is the layer we call access to the data that contains the Connection object. The purpose of the improvements in this layer is to save the database applications from the dependency of working with a single database. In other words, the goal is to build a structure that can work with multiple databases. Data Access Layer has access methods to databases and communication libraries used to access databases. We will also create and call our function, where we can assign value to our Specific Code field, which will be valid for each table in our Forms.

What is Common layer? What does it do? : We will define the Enums that can be used as common in the project here. The reason is to eliminate lines of repetitive code.. For example, we will create a class named GenderEnums rather than writing individual genders in all the forms that we will choose and instead of writing the same code in many forms, we will do the job by calling the enum we defined. It is very nice,isn’t it? :)

What is Data layer ? What does it do? : This layer allows us to communicate between the project and database. The program checks the DataSets that we added in debug mode. If there is a change in the tables in the attached tables, in the Entities in the Model layer after the Migration process, it makes the changes in the table and corrects the new table and continues the process. The only difference here is: Configuration.LazyLoadingEnabled = false; we ignore the differences that may occur with this code. For example, the first program worked codes as User_Name after debug, table was created, then we saved a few data. And we did UserName the name of User_Name on the Model layer, and we ran it again. In this case, the User_Name name was deleted from the table and we had to get it to avoid data loss. Because we do false , it will delete all the data and present it to us again.

What is Model layer? What does it do? : We define the table we create in the Model layer ie Entity’s columns. And here we define code fields in each Entities, we enable each Entity to be automatically added to the table by reference. Additionally, for some forms of Active/Passive records, we can define it once and call all entities instead of typing continuously public bool Status { get; set; } = true. When you review program codes, you will notice it already. We will also carry out the association process between the entities(tables) we will define here.

What is Win.Forms layer? What does it do? : The layer will be the opening layer of the project. All the codes and forms we will define in this layer will work with the layers we have created. All our modules we create will be implemented from 2 BaseForms. So we will quickly create our forms and write ther codes without having to design each form separately. All you have to do is to set the algorithm and then start creating the forms. I suggest you do it according to certain rules. In the Forms folder, create a folder named NewModuleName and then start form names by creating two forms called NewModuleNameListForm ve NewModuleNameEditForm.

From the View Code of NewModuleNameListForm, we implement the public partial class NewModuleNameListForm : BaseListForm from BaseListForm. In this way we are free from the trouble of design.

Program Configuration
When starting the project : Let’s connect our project to your computer or VDS server with the Sql Server 2016 program. As the file path, we open the file App.config in the PositiveSoftware.Project.Win layer and click If you add this code and you get an error like the following, here are the operations you will do:



If you get this kind of error, we will let the login called sa. First, we open our Microsoft SQL Server Management Studio 18 program and log in and click Security->Logins->right double click and set a password to Password and Confirm password in the General field (123456asd.F)



Base Edit Form View and Description
BaseEditForm Designer : BaseEditForm : In the project, we have created 2 BaseForm to avoid duplication of code and not to make continuous design arrangements.Thanks to these,the forms in all modules we will add will be implemented.

Thus all EditForms will work in the same design and logic. In this form, we will override the variables and functions that will be defined in the forms that were implemented and fill them. As a result, instead of writing code one by one in each form, we’ll write once and use it in the whole project.

New Button: Opens form in new recording mode

Save Button: Used to save changes to the form

Take It Back Button: Used to undo changes to the form

Delete Button: Runs in record deletion mode selected

Close Button: Used to close open form without making changes

BaseListForm Designer : BaseListForm : The listing forms of all modules to be included in the project will be added as an implementation from the above form.On the listing page , we first drag and drop a Gridview or Badedview into our form and right after that,we set the Dock property of one longNavigator to Bottom.. If you have added Gridview or Bandedview , whichever you added, we’ll make ‘Fill’ the Dock property of that component. Then click the Run Designer button on the added Gridview or Bandedview component and enter the Columns section. The id and defaultCode field that came from the database comes automatically. You just add the field you want to add to your module, then you can switch to the encoding section.

Objects in the Header

New Button: Opens EditForm in new recording mode

Delete Button: Runs in record deletion mode selected

Select Button: Used to make selections in subforms (ProvinceListForm or CountryListForm)

Refresh Button: Used to refresh data in GridView

Filter Button: Form shows the recorded related filters or new added

Columns Button: To hide or show data taken in GridView

Print Button: Used to print data from related forms

Send Button: Used to export data as Word, Excell, or Txt

Close Button: Used to close open form without making changes

Objects in the Footer

Insert,Select,Delete : Shortcuts and descriptions

InActive Card Button: Shows active or passive cards

Only for V.I.P
Warning! You are not allowed to view this text.