ASP.NET MVC 4 Query Portal

3

Work at a service company. In the company we have hundreds of Oracle and SQL-Server databases of all clients. These banks contain information on the equity items in that company as well as other business and financial information. As the work is performed the employees through the internal system feeds the various tables, such as: project steps, execution history, issuing invoices, tickets, schedules, etc.     Our goal is to create an area on the internet where the customer can log in and consult the information available to him.

I imagine a table with username and password where the system validates and verifies to which bases of which servers it has access.      If he has access to a single base the system already connects that base and he starts to consult his information regarding the execution of his work. If there is more than one base the system asks which base it wants to access and it follows equally.

As I recently used ASP.NET MVC 4 to build an application with RAZOR and found it quite productive I ask you, can I develop this new project using ASP.NET MVC 4? It would be cool because the client could access information, including the cell phone.

I can not imagine what the model would look like. Well, in theory, I would just have one table as the entryway and then the system connects to some other base and I'll do select there. Can I create the model based on a database and switch the connection back and forth at will?

Or should I replicate the columns that will be queried in other tables in the same database as the login table and trigger them in the original banks?

Do you know of a link that would give me a good idea how to do this?

If you're confused, I'm available for more information.

Thank you.

    
asked by anonymous 30.03.2016 / 20:58

1 answer

6
  

As I recently used ASP.NET MVC 4 to build an application with RAZOR and found it quite productive, I ask you how can I develop this new project using ASP.NET MVC 4?

In summary, yes.

  

I can not imagine what the model would look like. Well, in theory, I would just have one table as the entryway and then the system connects to some other base and I'll do select there. Can I create the model based on a database and toggle the connection back and forth?

First let's demystify this "use the connection somewhere else". In an ASP.NET MVC system, you can open as many connections as you want.

If you are going to use ASP.NET MVC4 (which is not very recommended because MVC4 is already an old standard), you can create a project with Entity Framework and define in the context created by the application its users and their respective levels of permission. This is done using Membership. I can link in this answer some articles that may be useful for this implementation, but I already notice that this may give some work.

In ASP.NET MVC5, creating the project with the Entity Framework and Individual User Accounts, you will have a practically ready mechanism for authenticating your users through ASP.NET Identity. Some tailoring is needed, but nothing too complicated. I can also put some articles that may be of interest to you.

Now, the most important: your legacy bases. You can map them using the Entity Framework or use other mechanisms to open the connection to your base, such as ADO.NET + Generic Repository or Dapper. For each table of its legacy bases, the correct one is to create a class (that in this context we call Model) with properties, being each property a column of its table. Once this has been done, each selection of data in the table must fill an object of the class per line found. Just to not lengthen the question much, I can put examples of how to do this later, or other questions.

I believe your databases in your clients should follow a table pattern, so this mapping is feasible. Already to decide on which basis to connect, you can create a scheme between users and companies, and for each company another scheme of which databases are used by each company. So you can dynamically set up connection strings and initialize your connections or data contexts according to the request made.

This concept is called multitenancy .

  

Or should I replicate the columns that will be queries in other tables in the same database as the login table and trigger them on the original banks?

This is not good from experience, especially if the technologies come from different banks. Better build an application that reads all the bases.

  

Do you know of a link that would give me a good idea how to do this?

This Q & A site is a good knowledge base. I'll direct you to the topics I mentioned above.

30.03.2016 / 21:25