How I Modernized a Legacy Delphi Warehouse System with React and .NET Core
This article recounts the complete redesign of a 2500‑person factory's Delphi‑based supply‑chain system, detailing the shift to a front‑end/back‑end separated architecture using React, Ant Design, and .NET Core 3.1, while addressing data consistency, rounding issues, UI habits, printing, and deployment challenges.
Background
More than a decade ago I built a supply‑chain warehouse system for a factory of about 2,500 employees using Delphi. The market offers many off‑the‑shelf ERP solutions, but the client needed a custom system that covered the entire supply process—from planning and quotation to contracts—beyond simple inbound/outbound and cost calculations. After a three‑month development and two‑month bug‑fix period, the system ran smoothly for years, with only a minor upgrade when the cost method changed to a moving average.
In October 2020 the factory wanted a major upgrade to strengthen business linkages and achieve full‑process material tracking. They needed one‑to‑one mapping of every transaction (e.g., who created the plan, which supplier provided the goods, dates of receipt and issue, remaining quantity). The original design lacked such direct relationships, so the upgrade required substantial data‑structure redesign while preserving existing data.
Because of a good prior relationship, the client trusted me with the upgrade, allowing me to work on it in my spare time with a flexible schedule. Although I had been in unrelated software work for nine years, I kept maintaining a C/S product and experimented with various technologies: Delphi for desktop, .NET, Python, Go for back‑end, and HTML/CSS/JS/jQuery, Angular, Vue, WeChat mini‑programs for front‑end.
Technology Selection
Clients usually care only about functionality, not technology. The legacy system was Delphi‑based, so continuing with Delphi would be low‑risk and efficient, but it would limit scalability for future mobile, tablet, and remote‑office scenarios, and offered little personal growth.
Final solution:
The server runs on Windows with SQL Server; historical data must be retained.
Adopt a front‑end/back‑end separation. The back‑end runs on .NET Core 3.1, suitable for Windows.
The front‑end uses React with Ant Design; Angular was considered but React‑Antd felt more reliable.
Development Process
The development went smoothly because the business processes were well‑known. Over five months I learned React and Ant Design while rebuilding the system, keeping most of the original database schema to preserve data. The system is essentially CRUD, but several technical details required careful handling.
Rounding
The system needed six‑decimal‑place cost calculations, but different languages handled rounding inconsistently:
JavaScript floating‑point arithmetic uses an international standard; toFixed() and Math.round() do not produce true round‑half‑up behavior.
C# allows specifying the rounding method, but its default is not the traditional round‑half‑up.
SQL Server’s round() works as expected for six‑decimal precision.
Excel’s round() also follows the usual rounding rule.
Because calculations occur on the front‑end, back‑end, and in exported Excel files, a unified rounding approach was required to keep results consistent.
Operation Habits
Document structure: switched from a master‑detail layout to a list/detail view to simplify UI control, which users quickly adapted to.
Enter‑key navigation: modified the input forms so the Enter key moves to the next row, as users preferred one‑hand data entry over the default Tab navigation.
Pagination: browsers cannot render all rows efficiently, so a configurable page size (up to 10,000 rows) was implemented to balance performance and user preference.
List entry: for bulk entry, rendered all rows as inputs on the page, allowing Enter to save each line automatically.
Printing
Printing required flexible templates and PDF generation. The solution reused the original Delphi printing component (DLL) and templates:
Created a small Delphi web server that receives HTTP commands to invoke the printing component.
The front‑end sends an HTTP request to the local web server (installed once on the client machine) to trigger printing.
The printing server is stateless; it simply receives template files and data via HTTP and produces the printed output.
Deployment
Deploying the .NET Core 3.1 service is straightforward: run dotnet project.dll on the desired port and use Nginx for reverse‑proxying. No IIS is required, and performance is good.
Conclusion
The upgraded system has been running for several months; the first two months involved fixing many bugs with valuable feedback from core users who know the system intricately. Listening to user concerns and understanding hidden business rules is crucial.
After more than half a year of work, I transitioned from a traditional C/S programmer to a modern front‑end/back‑end developer, reinforcing the principle of lifelong learning.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Interview Crash Guide
Dedicated to sharing Java interview Q&A; follow and reply "java" to receive a free premium Java interview guide.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
