Exemplo n.º 1
0
        /// <summary>
        /// 校区
        /// </summary>
        /// <returns></returns>
        public ActionResult Campus(int id = 0)
        {
            Campus model = _campusService.GetByIdAsync(id);

            if (model == null)
            {
                throw new Exception("校区不存在");
            }
            ViewBag.Imgs    = _campusService.GetImgsByCampusIdAsync(id) ?? new List <CampusImg>();
            ViewBag.Student = _studentService.GetListByCampusAsync(id, 4);
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id = 0)
        {
            Campus model  = new Campus();
            string action = "添加校区";

            if (id > 0)
            {
                model  = _campusService.GetByIdAsync(id);
                action = "修改校区";
            }

            ViewBag.Action = action;
            return(View(model));
        }