Solved

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

Posted on 2013-05-20
2
759 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

12 Experts available now in Live!

Get 1:1 Help Now