c# - Prepare If elseif else formula from UI in mvc4 -


i have prepare formula ui.

the formula if else if condition.

like :

if (middlename != "")     firstname + middlename else if (lastname != "")     firstname + lastname else     firstname 

there might more else if condition per requirement. how can implement in easier way ? have prepared on test app, in made using formcollection, finding key , prepare formula condition. but, there complex , lengthy process, if there minor change in condition, in future, there might lots of work, checking 2 conditions in if or else if.

any great appreciate.

edited : enter image description here

are looking this?

fieldstobechecked = //list of fields want check or enter values , remove text o.text var result = string.join(" ", fieldstobechecked.select(o => !string.isnullorwhitespace(o.text))); 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

how to receive file in java(servlet/jsp) -