简体   繁体   中英

How to interpret or calculate a value from a user input in C#?

I have to develop a Web application for a payroll system. I would like use C# and SQL server for the development. This payroll system has to calculate different formulas, which are defined by the users.

For example, the users will type in a input the text below and it will be saved in the BDD.

if salary > 4000 then calculateRate

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

We can have some formulas more complicated like :

if salary > 5000 
then calculateRate + variable 
else if salary > 10 000
then {
calculateRate + variable + bonus
}

Here:

  1. Salary = method
  2. calculateRate = method and "variable" is a variable pay that we have to search in the database
  3. bonus = a variable pay that we have to search in the database

or in the formulas the user can go to take a value in the BDD in typing :

if db.user_table.salary > 500
then calculateRate 
else if ....

I have some big questions about this developement : - how I can achieve it ? - does C# is the best solution ? or I have to use NodeJS for exemple - how to interpret in C# what the user will type

I need a performance solution because we will have many calculations to do.

  • how I can achieve it ?

This means that you're asking us how to create this program. Just the phrase: "This payroll system have to calculate differents formulas and these formulas are defined by the users. " tells me that your task is nearly impossible.

  • does C# is the best solution ?

I don't know. But I can tell you that C# is not the only solution

  • or I have to use NodeJS for exemple

Same answer. You need to obtain more specific instructions for what your program must do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM