This project is a suite of in-house tools developed to solve critical business problems for an Iranian company. The primary
motivation was to overcome the limitations and inaccuracies of a legacy accounting software that was cumbersome and unreliable
for the finance and sales departments. By directly interfacing with the company’s database, this suite provided fast, accurate,
and user-friendly solutions for financial calculations and reporting.
The finance department struggled with outdated software that made profit/loss calculations and reporting slow, error-prone, and
difficult. This project started as a prototype to bypass the software’s UI and access the data directly, ensuring accuracy and
efficiency. Over time, it evolved into a comprehensive toolkit that empowered both the finance and sales teams with real-time
insights and reliable reporting.
- Replaced unreliable manual processes with automated, accurate calculations.
- Enabled the sales team to access real-time performance data for better decision-making.
- Provided the finance team with fast, intuitive, and reliable reporting tools.
- Gained rapid adoption and recognition within the company from its first alpha release.
- C# (.NET Framework 4.7.2)
- Entity Framework (for ORM and database access)
- WinForms (for user interfaces)
- LINQ (for data querying)
- CSV/Excel Export (for reporting)
- Additional .NET libraries as required by business needs
- Interval Profit Calculation: Custom date-range profit/loss analysis with a user-friendly WinForms interface.
- Daily Invoice Aggregation: Aggregates and analyzes daily invoices for quick review and reporting.
- Data Export: Exports results to CSV and Excel for further analysis or sharing.
- Direct Database Access: Reads directly from the company’s accounting database for maximum accuracy.
- Profit Calculation (Console App): The original prototype, implemented as a console application, used to test and validate
the core calculation and export services of the solution.
- CalculateProfit/ – Console app for profit/loss calculation (prototype and service tester).
- IntervalCalculateProfit/ – WinForms app for interval-based profit/loss analysis.
- DailyInvoiceAggrigator/ – WinForms app for daily invoice aggregation.
- DataAccessLayer/ – Entity models and database access logic.
- Services/ – Business logic for calculations and exports.
- PresentationLayer/ – Additional WinForms UI for data review.
- Entities/ – Entity definitions and data mapping.
- Clone the repository.
- Open HadishSolution.sln in Visual Studio.
- Restore NuGet packages if prompted.
- Build the solution.
- Run the desired project (e.g., IntervalCalculateProfit, DailyInvoiceAggrigator, or CalculateProfit).
Note: These tools are designed to work with the company’s specific database schema. Some features may require
configuration or adaptation for use outside the original environment.
Important: Do NOT hardcode sensitive information (such as database usernames or passwords) in source code or configuration files. You must set the following environment variables before running the applications:
- HADISH_DB_DATASOURCE — SQL Server address (e.g., 192.168.255.100)
- HADISH_DB_USERID — SQL Server username (e.g., sa)
- HADISH_DB_PASSWORD — SQL Server password (e.g., yourStrongPassword)
Some config files may use {DATA_SOURCE}, {USER_ID}, and {PASSWORD} placeholders. Set corresponding environment variables as needed for your deployment.
Setting Environment Variables
Windows (Command Prompt):
set HADISH_DB_DATASOURCE=192.168.255.100
set HADISH_DB_USERID=sa
set HADISH_DB_PASSWORD=yourStrongPassword
Note: Never commit actual credentials to version control. Always use environment variables or a secure secrets manager for sensitive data.