README.md (3084B)
1 # MVC Database Project Overview 2 3 This repository showcases an ASP.NET MVC rewrite of a previous [PHP database project](https://github.com/LindholmLabs/PHP-databaskonstruktion). It illustrates the development of a web-based interface for managing database operations, emphasizing efficient data handling and secure user interaction in an MVC environment. 4 5  6 7 ## Project Features 8 9 ### Modal Form Generation 10 - **ModalBuilder**: Streamlines creating input forms for database tables through the use of partials. 11 - **ASP.NET Core Integration**: Utilizes "secrets" files for securely storing database connection parameters. 12 - **Generic Functionality**: Adapts to various database tables for data insertion or modification. 13 14  15 16 ### Data Handling and Database Interaction 17 - **DatabaseRepository Class**: Manages incoming data from forms, organizing it into key-value pairs for database interaction. 18 - **Dynamic SQL Query Generation**: Constructs "INSERT" queries based on provided data, safeguarding against SQL injections. 19 20 ### List Input Handling 21 - **Automated Dropdown Generation**: Facilitates selection of foreign composite primary keys. 22 - **Seamless Database Connectivity**: Leverages "GetTable" function for fetching entire database tables or specific columns. 23 24 ### Search Implementation 25 - **Character Matching**: Employs SQL "LIKE" queries for effective data searching based on user input. 26 - **Controller-Model Interaction**: Efficiently processes search parameters and returns the relevant data. 27 28 ### Data Modification 29 - **Dynamic ActionLinks**: Creates links for each table row, enabling data deletion or detailed view. 30 - **DeleteRow Function**: General method for deleting data based on primary key values, enhancing code reusability. 31 32 ### Stored Procedure Execution 33 - **Procedure Handling**: Executes stored procedures like "GetOperationsInRange" based on user-defined date ranges. 34 35 ### Table Display 36 - **TableBuilder Class**: Constructs table objects that are rendered using a "_TablePartial". 37 - **Dynamic Header Generation**: Automatically creates table headers from database column names. 38 39 ### Dynamic Link Generation 40 - **Flexible URL Creation**: Generates links for data deletion or detailed views using "RouteValueDictionary". 41 42 ### Hidden Field Usage 43 - **Contextual Data Submission**: Employs hidden fields in forms to pass pre-determined data like incident names and numbers, if the user has previosly selected an incident or other table with support for detail views. 44 45 ## Repository Details 46 47 - **Codebase**: The project's code and implementation details can be accessed in the repository. 48 - **Database**: View [database implementation](https://github.com/LindholmLabs/PHP-databaskonstruktion/blob/a3a5f0a6822ac9531281a3530e60e70374d1669f/src/database.md) in original PHP-project. 49 - **MVC Approach**: Highlights the transition from PHP to ASP.NET MVC, showcasing the application of the MVC architectural pattern. 50 - **Paper**: View academic paper here: [MVC_report_sv.pdf](src/MVC-applikation_rapport.pdf)