Exemplo n.º 1
0
        public ActionResult CreateSchoolLevel(ComSchoolLevelViewModel model)
        {
            if (model != null)
            {
                if (!String.IsNullOrEmpty(model.name))
                {
                    bool result = commonListUnitOfWork.CreateSchoolLevel(model.name, model.levelNum);

                    if (result)
                    {
                        TempData["successmessage"] = "Tạo bằng cấp " + model.name + " thành công.";
                    }
                    else
                    {
                        TempData["errormessage"] = "Tạo bằng cấp " + model.name + " thất bại!";
                    }
                }
                else
                {
                    TempData["errormessage"] = "Dữ liệu không hợp lệ!";
                }
            }
            else
            {
                TempData["errormessage"] = "Có lỗi xảy ra!";
            }

            return(RedirectToAction("SchoolLevelList"));
        }
Exemplo n.º 2
0
        public ActionResult SchoolLevelList()
        {
            ComSchoolLevelViewModel model = new ComSchoolLevelViewModel();

            model.schoolLevels = commonListUnitOfWork.SchoolLevelRepository.Get(s => s.IsDeleted == false).OrderByDescending(s => s.LevelNum).AsEnumerable();
            model.name         = "";

            return(View(model));
        }