예제 #1
0
        public ActionResult Save(RecruitJob entity)
        {
            var ValidRecruitJob = RecruitJobBz.IsExist(o => o.JobName == entity.JobName && o.ID != entity.ID);

            if (ValidRecruitJob)
            {
                ViewBag.Msg = $"招聘的职位已存在{entity.JobName}!";
                return(View("RecruitJobEdit", entity));
            }

            var isSuccess = RecruitJobBz.SaveOrUpdate(entity, entity.ID > 0);

            if (isSuccess)
            {
                ViewBag.Msg = "保存成功!";
            }
            else
            {
                ViewBag.Msg = "保存失败!";
            }
            var model = RecruitJobBz.Get(o => o.JobName == entity.JobName);

            return(View("RecruitJobEdit", model));
        }
예제 #2
0
        public ActionResult RecruitJobEdit(int id)
        {
            var model = RecruitJobBz.Get(o => o.ID == id);

            return(View(model));
        }