public ActionResult CreateNew() { BLLSchool bs = new BLLSchool(); Models.School sc = new Models.School(); sc.SchoolName = "新学校"; bs.Add(sc); //创建学校,同时创建学校和用户的关系 Models.ManageUser mu = new Models.ManageUser(); mu.UserName = User.GetUserName(); mu.SchoolID = sc.SchoolID; User.SetSchoolID(sc.SchoolID); new BLLManageUser().Add(mu); return View("Edit", sc); //return Redirect("Edit?schoolid=" + sc.SchoolID); //return RedirectToAction("Edit", new { schoolid = sc.SchoolID }); }
public ActionResult Edit(Models.School school) { BLL.BLLSchool bs = new BLLSchool(); Models.School sc = bs.Find(school.SchoolID); sc.SchoolName = school.SchoolName; bs.UpDate(sc); return View(sc); }
// // GET: /Course/ public ActionResult Index() { AutoCourse.Models.School school = new BLLSchool().Find(User.GetSchoolID()); return View(school); }