Calculation in code behind

前端 未结 5 1259
悲哀的现实
悲哀的现实 2021-01-28 04:50

Chauffeur service cost $30. It is an option to user whether they want the service or not. When they already select car, and day of rental, I store it in session.



        
5条回答
  •  情书的邮戳
    2021-01-28 05:08

    totalValue = int.Parse(Session["price"].ToString()) * int.Parse(Session["day"].ToString()) + ShowFerInUse ? 30 : 0;

    This way you can use iif equivalent in c# and do ShowFerInUse at same time.

提交回复
热议问题