jeudi 30 août 2018

Design pattern required

A customer can place one order. Each order till its delivered goes trough different phases. Lets say there are many phases A,B,C,D,E. Moving through these phases will be done manually from a single client. From A-> B (or) E , B -> C , C -> D (or) E

Each phases require different inputs from user to move to next phase. All these inputs are different entities as modelled in system.

In UI level I have a dropdown. If current status is A then dropdown shows B and E. If B then C. Value for dropdown is coming from database from a master table. On choosing different option I am showing different forms to user using JQuery.

I have multiple ifs stacked up in my code both on .cshtml page and server side. Is there any better approach to do this? Any design pattern that will help me in this scenario?

If I am doing anything wrong then please suggest.

Aucun commentaire:

Enregistrer un commentaire