Solved

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

Posted on 2013-05-20
2
757 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
2 Comments
 
LVL 25

Expert Comment

by:apeter
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now