Simple Solution is use 'ViewModel' class. In this class add two List<type> properties and pass the viewmodel object to view.
Public Class MyViewModel
{
Public List<SuccessFailureModel> List1{get;set;}
Public List<SuccessFailureModel> List2{get;set;}
}
namespace Tesco.RetalixTenNFR.MVC.Controllers
{
public class SuccessFailureController : Controller
{
//
// GET: /SuccessFailure/
public ActionResult Index()
{
List<SuccessFailureModel> SuccessFailureObjList = new List<SuccessFailureModel>();
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "UK", Stores = 257, Tills = 420, Tokens = 1200, OverallBrag = "RED" });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "Format And Store Type", Stores =null, Tills = null, Tokens = null, OverallBrag = null });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "Non Express", Stores = 30, Tills = 100, Tokens = 500, OverallBrag = "RED" });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "SuperStore", Stores = 25, Tills = 50, Tokens = 150, OverallBrag = "RED" });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "Metro", Stores = 50, Tills = 48, Tokens = 75, OverallBrag = "RED" });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "HomePlus", Stores = 0, Tills = 200, Tokens = 2, OverallBrag = "RED" });
SuccessFailureObjList.Add(new SuccessFailureModel { FormatStoreType = "Express", Stores = 150, Tills = 220, Tokens = 473, OverallBrag = "RED" });
List<OverAllDmsBrag> OverAllObj = new List<OverAllDmsBrag>();
OverAllObj.Add(new OverAllDmsBrag { OverAllDms = "Over All DMS Brag", OverallBragColor = "RED" });
MyViewModel model=new MyViewModel();
model.List1=SuccessFailureObjList;
model.List2=OverAllObj;
return View(model);
//return View(SuccessFailureObjList);
}
}
}