}//end //可以去掉system.data引用 public List<EnglishContent> GetContentByLesson(EnglishLesson lesson) { string sql = string.Concat("SELECT * FROM EnglishContent WHERE EnglishLessonID = '", lesson.ID, "'"); DataSet ds = SqlHelper.GetDataSet(sql); List<EnglishContent> wordList = dao.ConvertToObject(ds.Tables[0]); return wordList; }//end
public ActionResult AddLesson(EnglishLesson lesson, string password) { if (lesson == null || !QueueSearch.IsAdmin(HttpContext, db)) return RedirectToAction("Index"); if (ModelState.IsValid) { englishBLL.AddLesson(lesson); return RedirectToAction("Index"); } return View(lesson); }//end
public int DeleteLessonById(EnglishLesson lessonList) { return dao.DeleteById(lessonList); }//end
public int AlertLesson(EnglishLesson lesson) { return dao.UpdateById(lesson); }
public int AddLesson(EnglishLesson lesson) { return dao.Save(lesson); }//end
public Boolean AlertLesson(EnglishLesson lesson) { return lessonServer.AlertLesson(lesson) > 0; }// end
public Boolean AddLesson(EnglishLesson lesson) { return lessonServer.AddLesson(lesson) > 0; }
}//end public ActionResult AlertLesson(int id) { if (id == 0 || !QueueSearch.IsAdmin(HttpContext, db)) return RedirectToAction("Index"); List<EnglishLesson> list = englishBLL.GetLessonById(id); EnglishLesson lesson = new EnglishLesson(); if (list.Count > 0) { lesson = list[0]; } return View(lesson); }//end
public ActionResult AlertLesson(EnglishLesson lesson, string password) { if (lesson == null || !QueueSearch.IsAdmin(HttpContext, db)) return RedirectToAction("Index"); englishBLL.AlertLesson(lesson); //EnglishLesson les= db.EnglishLesson.Where(p => p.ID.Equals(lesson.ID)).FirstOrDefault(); //les.LessonDescription = lesson.LessonDescription; //les.LessonNotesLink = lesson.LessonNotesLink; //les.LessonText = lesson.LessonText; //db.SaveChanges(); return RedirectToAction("Index"); }//end