PublicActionResult Index ()
{
SQL SQL1 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z001"). ("Sequence desc");
Ilist<newsinfo> List1 = newsservice.getlist (SQL1,6);
SQL SQL2 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z002"). ("Sequence desc");
Ilist<newsinfo> List2 = newsservice.getlist (SQL2,5);
SQL SQL3 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z003"). ("Sequence desc");
Ilist<newsinfo> list3 = newsservice.getlist (Sql3,6);
SQL SQL4 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z004"). ("Sequence desc");
ilist<newsinfo> list4 = newsservice.getlist (Sql4,6);
SQL SQL5 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z005"). ("Sequence desc");
ilist<newsinfo> list5 = newsservice.getlist (SQL5,6);
SQL sql6 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z006"). ("Sequence desc");
ilist<newsinfo> List6 = newsservice.getlist (sql6,6);
SQL SQL7 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z007"). ("Sequence desc");
ilist<newsinfo> list7 = newsservice.getlist (SQL7,4);
SQL Sql8 =NewSQL (). Append ("WHERE DataType = @0 and Ismystates=1 and Isadminstates=1 and Isdefault=1","Z008"). ("Sequence desc");
ilist<newsinfo> list8 = newsservice.getlist (Sql8,2);
//ilist<constdatainfo> list9 = Constdataservice.getconstdatalistleafbytype ("C0001");
//ilist<constdatainfo> list10 = Constdataservice.getconstdatalistleafbytype ("C0002");
//ilist<constdatainfo> list11 = Constdataservice.getconstdatalistleafbytype ("C0003");
Viewbag.jlist = Constdataservice.getconstdatalistrootbytype (EnumUtil.ConstDataType.JfjcType);
returnView (NewIndexmodel (List1, List2, List3, List4, List5, List6, List7, List8));
}
Model
public class indexmodel { public ilist<newsinfo> List1 {get; private set;} public ilist<newsinfo> list2 {get; private set;} public ilist<newsinfo> list3 {get; private set;} public ilist<newsinfo> list4 {get; private set;} public ilist<newsinfo> list5 {get; private set;} public ilist<newsinfo> List6 {get; private set;} public ilist<newsinfo> list7 {get; private set;} public ilist<newsinfo> list8 {get; private set;} public Indexmodel (ilist<newsinfo> s1, ilist<newsinfo> S2, ilist<newsinfo> S3, Ilist<newsinfo> S4, Ilist<newsinfo> S5, Ilist<newsinfo> S6, Ilist<newsinfo> S7, IList< newsinfo> S8) {   This.list1 = s1; THIS.LIST2 = s2; THIS.LIST3 = s3; THIS.LIST4 = s4; &NBSP ; THIS.LIST5 = s5; THIS.LIST6 = s6; THIS.LIST7 = s7; THIS.LIST8 = s8; } &nbs P }
Foreground HTML
<div class= "Zhongxia" > &NB Sp @foreach (var item2 in Model.list2) &NB Sp { &N Bsp <div class= "Zhongxiain" > and nbsp <div class= "Liebiao" & gt; <a href= "/news/index/@item2. ID" > @MSP. Utility.WebUtilityHelper.GetCutString (item2. Datatitle &NB Sp </a> </div> &NBSP ; <div class= "Riqi" > , &NB Sp <a href= "/news/index/@item2. ID" > @MSP. Utility.WebUtilityHelper.GetDateString (item2. Createtime) </a> </div> &NBS P </div> &NBS P &NBS P } &N Bsp </div>
MVC View Returns a list of lists