示例#1
0
 //
 // GET: /News/
 #region <ActionResult>
 public ActionResult Index(string Module)
 {
     HealthEducationList HElist = new HealthEducationList();
     if (Module != null)
         HElist.selectedModuleId = Module;
     HElist.ModuleList = new List<SelectListItem>();
     DataSet ModuleInfo = _ServicesSoapClient.GetMstTaskByParentCode("TD0000");
     foreach (DataRow Row in ModuleInfo.Tables[0].Rows)
     {
         SelectListItem NewLine = new SelectListItem();
         NewLine.Value = Row[1].ToString();
         NewLine.Text = Row[2].ToString() + "模块";
         HElist.ModuleList.Add(NewLine);
     }
     if (HElist.selectedModuleId == "")
     {
         HElist.selectedModuleId = "TD0001";
     }
     DataSet info = _ServicesSoapClient.GetMstTaskByParentCode(HElist.selectedModuleId);
     SelectListItem SelectedModule = HElist.ModuleList.Find(
         delegate(SelectListItem x)
         {
             return x.Value == HElist.selectedModuleId;
         });
     foreach (DataRow row in info.Tables[0].Rows)
     {
         HealthEducation news = new HealthEducation();
         news.Module = HElist.selectedModuleId;
         news.ModuleName = SelectedModule.Text;
         news.Id = row[1].ToString();
         news.Path = row[9].ToString();
         news.Title = row[2].ToString();
         news.CreateDateTime = row[10].ToString();
         news.Author = row[11].ToString();
         news.AuthorName = row[12].ToString();
         HElist.HEList.Add(news);
     }
     return View(HElist);
 }
示例#2
0
        public ActionResult Index()
        {
            HealthEducationList HElist = new HealthEducationList();
            DataSet info = _ServicesSoapClient.GetAddressByTypeList(HElist.selectedModuleId, 5);
            foreach (DataRow row in info.Tables[0].Rows)
            {
                HealthEducation news = new HealthEducation();
                news.Module = row[0].ToString();
                news.ModuleName = row[1].ToString();
                news.Id = row[2].ToString();
                news.Type = Convert.ToInt32(row[3].ToString());
                news.FileName = row[5].ToString();
                news.Path = row[6].ToString();
                news.Title = row[7].ToString();
                news.CreateDateTime = row[8].ToString();
                news.Author = row[9].ToString();
                news.AuthorName = row[10].ToString();

                HElist.HEList.Add(news);
            }
            return View(HElist);
        }