コード例 #1
0
ファイル: SchoolController.cs プロジェクト: qiji/AutoCourse
        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 });
        }
コード例 #2
0
ファイル: SchoolController.cs プロジェクト: qiji/AutoCourse
 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);
 }
コード例 #3
0
ファイル: CourseController.cs プロジェクト: qiji/AutoCourse
 //
 // GET: /Course/
 public ActionResult Index()
 {
     AutoCourse.Models.School school = new BLLSchool().Find(User.GetSchoolID());
     return View(school);
 }