/// <summary> /// 资源平台初始化 /// </summary> /// <returns></returns> public ActionResult Index() { #region 判断是否在有效期内 //if (!Constant.IsRegister()) //{ // try // { // return RedirectToAction("Index", "Register"); // //int res = MicrosoftOffice.TimeClass.InitRegedit();//判断是否在有效期内 // //if (res != 0) // //{ // // return RedirectToAction("Index", "Register"); // //} // } // catch (Exception ex) // { // string s = ex.Message; // return RedirectToAction("Index", "Register"); // } //} #endregion SetConfig(); List <View_Res_Appendix> docList = new List <View_Res_Appendix>(); List <View_Res_Appendix> videoList = new List <View_Res_Appendix>(); List <ComboTreeModels> rtlist = new List <ComboTreeModels>(); List <V_Public_Type> models = new List <V_Public_Type>(); using (JSZX_ResourceEntities db = new JSZX_ResourceEntities()) { ResourceList relist = new ResourceList(); docList = relist.GetExcellentAppendix("0,2,3", db); videoList = relist.GetExcellentAppendix("1", db); //rtlist = relist.GetResTypeList("tree", db); models = db.V_Public_Type.OrderBy(t => t.CREATETIME).ToList(); } int docCount = docList.Count / 4 + (docList.Count % 4 > 0 ? 1 : 0); int videoCount = videoList.Count / 4 + (videoList.Count % 4 > 0 ? 1 : 0); ViewData["docList"] = docList; ViewData["docCount"] = docCount; ViewData["videoList"] = videoList; ViewData["videoCount"] = videoCount; ViewData["typeList"] = rtlist; JavaScriptSerializer js = new JavaScriptSerializer(); js.MaxJsonLength = Int32.MaxValue; string json = js.Serialize(models); //js.Serialize(rtlist); ViewData["typeTree"] = json; return(View()); }