public ActionResult Create()
        {
            NewHealthEducationFile nhe = new NewHealthEducationFile();

            nhe.selectedModuleId = "TD0001";
            nhe.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() + "模块";
                nhe.ModuleList.Add(NewLine);
            }
            return(View(nhe));
        }
Exemple #2
0
        public ActionResult Edit(string Module, string Id)
        {
            TaskDetailInfo  info = _ServicesSoapClient.GetCmTaskItemInfo(Module.Substring(0, 2), Id);
            HealthEducation news = new HealthEducation();

            news.Module         = Module;
            news.Id             = Id;
            news.Path           = info.OptionCategory;
            news.Title          = info.Name;
            news.CreateDateTime = info.CreateDateTime.ToString();
            news.Author         = info.Author;
            news.AuthorName     = info.AuthorName;

            string       dir = Server.MapPath("/");
            StreamReader sr  = new StreamReader(dir + news.Path.Substring(1).Replace("/", "\\"), Encoding.GetEncoding("GB2312"));

            string temp;

            news.htmlContent = "";
            if ((temp = sr.ReadLine()) != null)
            {
                Regex           reg = new Regex(@"<body>([\s\S]*)</body>", RegexOptions.IgnoreCase);
                MatchCollection mc  = reg.Matches(temp);
                news.htmlContent = mc[0].Value;
                news.htmlContent = news.htmlContent.Substring(6, news.htmlContent.Length - 13);
            }
            sr.Close();
            NewHealthEducationFile nhe = new NewHealthEducationFile();

            nhe.selectedModuleId = Module;
            nhe.news             = news;
            nhe.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() + "模块";
                nhe.ModuleList.Add(NewLine);
            }
            return(View(nhe));
        }
Exemple #3
0
        public ActionResult Edit(string Module, string Id)
        {
            DataSet         info = _ServicesSoapClient.GetAll(Module, Id);
            HealthEducation news = new HealthEducation();

            if (info.Tables[0].Rows.Count > 0)
            {
                DataRow row = info.Tables[0].Rows[0];
                news.Module         = Module;
                news.Id             = Id;
                news.Type           = Convert.ToInt32(row[2].ToString());
                news.FileName       = row[4].ToString();
                news.Path           = row[5].ToString();
                news.Title          = row[6].ToString();
                news.CreateDateTime = row[7].ToString();
                news.Author         = row[8].ToString();
                news.AuthorName     = row[9].ToString();

                string       dir = Server.MapPath("/") + "HealthEducation\\";
                StreamReader sr  = new StreamReader(dir + news.FileName, Encoding.GetEncoding("GB2312"));

                string temp;
                news.htmlContent = "";
                if ((temp = sr.ReadLine()) != null)
                {
                    Regex           reg = new Regex(@"<body>([\s\S]*)</body>", RegexOptions.IgnoreCase);
                    MatchCollection mc  = reg.Matches(temp);
                    news.htmlContent = mc[0].Value;
                    news.htmlContent = news.htmlContent.Substring(6, news.htmlContent.Length - 13);
                }
                sr.Close();
            }
            NewHealthEducationFile nhe = new NewHealthEducationFile();

            nhe.selectedModuleId = Module;
            nhe.news             = news;
            return(View(nhe));
        }
Exemple #4
0
        public ActionResult Create()
        {
            NewHealthEducationFile nhe = new NewHealthEducationFile();

            return(View(nhe));
        }