Solved

ASP.Net MVC 4 C# -- one BIG page vs. multiple pages ?

Posted on 2013-05-20
2
765 Views
Last Modified: 2013-05-23
I have about 10 programs (Buick, Ford, Chevy, etc) that are very workflow driven.

a. What option would you pick ?
b. What "workflow" engine (windows workflow foundation, etc) would you use for this MVC project ?

I like "Option #1" because it is one page to code,
but don't like since it has lots of if/then statements, etc
making the code hard to easily review/tweak.
------------------------------------------------------------------------------------------------------------------------
Option #1 --> do via on one COMPANY-WIDE "matReq.cshtml"
 1. create \Controllers\CarController.cs, RMB on INDEX method, new, VIEW
 2. open \Views\Car\Index.cshtml, make HTML changes
 3. open \Views\Shared\_Layout.cshtml, add below
      ** <li>@Html.ActionLink("Buick testing", "Index", "Car")</li>
      ** <li>@Html.ActionLink("Ford testing",  "Index", "Car")</li>
      ** <li>@Html.ActionLink("Chevy testing", "Index", "Car")</li>
 4. do some type of if/then statements on the one COMPANY-WIDE matReq.cshtml
      ** if passed in link = Ford, then
           ** textbox1, textbox2, and textbox3 required
           ** workflow approved by four management levels
           ** only supervisors can edit "matReq.cshtml" stage #7 documents
           ** JohnDoe is a Ford supervisor per ASP.NET Web Site Administration Tool user group
      ** if passed in link = Chevy, then
           ** comboBOx4, textbox21, and textbox32 required
           ** workflow approved by seven management levels
           ** only contractors can edit "matReq.cshtml" stage #9 documents
           ** JohnDoe is a Chevy contractor per ASP.NET Web Site Administration Tool user group
      ** etc
----------------------------------------
Option #2 --> do via multiple "matReq.cshtml", one for each program
 1. create \Controllers\BuickController.cs, RMB on INDEX method, new, VIEW
 2. open \Views\Buick\Index.cshtml, make HTML changes
 3. open \Views\Shared\_Layout.cshtml, add below
      ** <li>@Html.ActionLink("Buick testing", "Index", "Buick")</li>
 4. repeat for other PROGRAMS (Ford, Chevy, etc)
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 39184660
In Option 1 , you can do  the same in controller and return the relevant view instead of doing it in the view itself.
0
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 500 total points
ID: 39185564
Hi,

1. You can do this with a single controller with multiple models and views.

2. Or you can do this with a controller, model and views for each program.

Personally I would choose option number 2 because this way I can very easy tweak or review a specific program.
Also you can do abstraction even further to create a common interface or abstract class that implements the required methods for all programs and implement them in thier controllers, models and views.

Also you can integrate more easly the Windows Workflow Foundation workflows with different controllers, each having it's own workflow avoiding if statements.


Regards,
Mishu
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question