Beispiel #1
0
        public ActionResult Index( SEMS.ViewModels.BaseSearch model )
        {
            //下拉框填充
            var yearlist = BLL.Evaluation_yearBS.GetEvaluation_yearList();
            List<SelectListItem> list = new List<SelectListItem>();
            foreach (var item in yearlist)
            {
                list.Add(new SelectListItem()
                {
                    Text = item.evaluation_year_name,
                    Value = item.evaluation_year_id.ToString()
                });
            }
            ViewBag.List = list;
            //填充完毕

            if (BLL.StudentBS.FindStudent(model.student_id) != null)
            {
                return RedirectToAction("Show", new
                {
                    studentid = model.student_id,
                    year_id = model.year_id
                });
            }
            else
                ModelState.AddModelError("", "无此学号");
            return View(model);
        }
Beispiel #2
0
 public ActionResult ModifySys(SEMS.Models.Sysinfo model )
 {
     if (ModelState.IsValid && BLL.SysinfoBS.ModifySysinfo(model))
     {
         return RedirectToAction("Index");
     }
     else
         ModelState.AddModelError("", "修改失败!");
     return View(model);
 }
Beispiel #3
0
 public ActionResult ModifyPolicy( string selectedmodule, SEMS.Models.Policy model )
 {
     if (BLL.PolicyBS.ModifyPolicy(selectedmodule, model))
     {
         return RedirectToAction("Index");
     }
     else
         ModelState.AddModelError("", "修改失败!");
     model.module_id = selectedmodule;
     return View(model);
 }
Beispiel #4
0
 public ActionResult SetNews( SEMS.Models.News model )
 {
     model.new_date = DateTime.Now;
     model.admin_id = User.Identity.Name;
     if (BLL.NewsBS.AddNews(model))
     {
         return RedirectToAction("Index");
     }
     else
         ModelState.AddModelError("", "发布失败!");
     return View(model);
 }
Beispiel #5
0
        public ActionResult EditorNews( int id , SEMS.Models.News model )
        {
            model.admin_id = User.Identity.Name;
            if (BLL.NewsBS.ModifyNews(id, model))
            {
                return RedirectToAction("Index");
            }
            else
                ModelState.AddModelError("", "编辑失败!");

            return View(model);
        }
Beispiel #6
0
        public ActionResult Add( SEMS.Models.Classes model )
        {
            if (BLL.ClassesBS.AddClass(model))
            {
                return RedirectToAction("Index", "Classes");
            }
            else
                ModelState.AddModelError("", "添加失败!");

            //添加失败
            return View(model);
        }
Beispiel #7
0
        public ActionResult ChangePassword(SEMS.ViewModels.ChangePassWord model)
        {
            //if (BLL.AdministraterBS.ChangePassword("tclh123", model.Newpwd,model.Oldpwd))
            if (BLL.AdministraterBS.ChangePassword(User.Identity.Name, model.Newpwd, model.Oldpwd))
            {
                return RedirectToAction("Index", "Home");
            }
            else
                ModelState.AddModelError("", "密码输入错误!");

            //修改失败
            return View(model);
        }
Beispiel #8
0
        public ActionResult Edit(int id , SEMS.Models.Evaluation_entry model )
        {
            //为所属模块创建下拉列表数据
            SelectList list = new SelectList(BLL.ModuleBS.GetModuleIDList());
            ViewBag.List = list;
            //创建完毕
            ViewBag.ID = id;

            if (ModelState.IsValid && BLL.Evaluation_entryBS.ModifyEvaluation_entry(id, model))
            {
                return RedirectToAction("Index");
            }
            else
                ModelState.AddModelError("", "修改失败");
            return View(model);
        }
Beispiel #9
0
        public ActionResult Create( SEMS.Models.Evaluation_entry model )
        {
            if (ModelState.IsValid && BLL.Evaluation_entryBS.AddEvaluation_entry(model))
            {
                return RedirectToAction("Index");
            }
            else
                ModelState.AddModelError("", "创建失败");

            //创建下拉框数据
            SelectList list = new SelectList(BLL.ModuleBS.GetModuleIDList());
            ViewBag.List = list;
            //创建完毕

            //创建失败
            return View(model);
        }
        public ActionResult Create( SEMS.Models.Student student )
        {
            if (BLL.StudentBS.AddStudent(student))
                return RedirectToAction("Index");
            else
                ModelState.AddModelError("", "添加失败!");

            //创建班级下拉框
            var classlist = BLL.ClassesBS.GetClassIdList();
            List<SelectListItem> idlist = new List<SelectListItem>();
            foreach (var item in classlist)
            {
                idlist.Add(new SelectListItem()
                {
                    Text = item,
                    Value = item
                });
            };
            ViewBag.ClassList = idlist;
            //创建班级下拉框完毕
            return View(student);
        }
Beispiel #11
0
 public ActionResult MultiModify(SEMS.ViewModels.ModifyScore model)
 {
     int id = int.Parse(model.entry_id);
     if (BLL.Entry_scoreBS.AllModifyEntry_score(id, model.score))
         return RedirectToAction("Index");
     else
     {
         //为下拉框填充数据
         List<SEMS.Models.Evaluation_entry> scorelist = BLL.Evaluation_entryBS.GetCurEvaluation_entryList();
         List<SelectListItem> list = new List<SelectListItem>();
         foreach (var item in scorelist)
         {
             list.Add(new SelectListItem()
             {
                 Text = item.Description,
                 Value = item.entry_id.ToString()
             });
         }
         ViewBag.List = list;
         //填充完毕
         return View(model);
     }
 }
Beispiel #12
0
        public ActionResult SingleModify(SEMS.ViewModels.ModifyScore model)
        {
            if (BLL.StudentBS.FindStudent(model.student_id)!=null)
            {
                SEMS.Models.Entry_score entry_score = new Models.Entry_score()
                    {
                        student_id = model.student_id,
                        entry_id = int.Parse(model.entry_id),
                        score = model.score
                    };
                if (BLL.Entry_scoreBS.GetEntry_score(entry_score.student_id, entry_score.entry_id) == 0)
                {
                    BLL.Entry_scoreBS.AddEntry_score(entry_score);
                }
                else if (BLL.Entry_scoreBS.GetEntry_score(entry_score.student_id, entry_score.entry_id) == -1)
                {
                    throw new Exception();
                }
                else
                    BLL.Entry_scoreBS.ModifyEntry_score(entry_score.student_id, entry_score.entry_id, entry_score.score);
                return RedirectToAction("Index");
            }
            else
            {
                //为下拉框填充数据
                List<SEMS.Models.Evaluation_entry> entrys = BLL.Evaluation_entryBS.GetCurEvaluation_entryList();
                List<SelectListItem> list = new List<SelectListItem>();
                foreach (var item in entrys)
                {
                    list.Add(new SelectListItem()
                    {
                        Text = item.Description,
                        Value = item.entry_id.ToString()
                    });
                }
                ViewBag.List = list;
                //填充完毕

                ModelState.AddModelError("", "不存在此学生!");
                return View(model);
            }
        }
 public ActionResult MultiDelete( SEMS.Models.Classes model )
 {
     //填充下拉框
     var classlist = BLL.ClassesBS.GetClassIdList();
     ViewBag.ClassList = new SelectList(classlist);
     var smalllist = BLL.ClassesBS.GetSmall_ClassIdList();
     ViewBag.SmallList = new SelectList(smalllist);
     //填充完毕
     if (BLL.ClassesBS.FindClass(model.class_id, model.class_small_id)!=null)
     {
         if (BLL.StudentBS.AllDelStudent(model.class_id, model.class_small_id))
         {
             return RedirectToAction("Index");
         }
         else
             ModelState.AddModelError("", "删除失败!");
         return View(model);
     }
     else
         ModelState.AddModelError("", "不存在此班级!");
     return View(model);
 }