javascript – How to interpret or calculate a value from a user entry in C #?

I need to develop a web application for a payroll system. I would like to use C # and SQL Server for development. This payroll system must calculate different formulas and these formulas are defined by the users.

For example, users will enter an entry with the text below and it will be saved in the DB.

if salary> 4000 then calculate Rate

knowing that "salary" can be a method that calculates salary over several months and "calculateRate" is a method too.

We can have some more complicated formulas like:

if salary> 5000
then calculate Rate + variable
if not if salary> 10,000
then {
CalculateRate + variable + bonus
}

Salary = method

CalculateRate = method and "variable" is a salary variable that we must search in the database
bonus = a variable pay that we have to look for in the database

or in formulas, the user can take a value in the database by typing:

if db.user_table.salary> 500
then calculate the rate
else if ....

I have big questions about this development:
– how can I get there?
– It's the best solution? or I have to use NodeJS for example
– how to interpret in C # what the user will type

I need a powerful solution because we will have a lot of calculations to do.