コード例 #1
0
        public ActionResult DoRecruitment(Recruitment objRec)//映射数据模型
        {
            //验证非空!!自己补充

            //调用BLL
            objRec.PublishTime = DateTime.Now;//设置当前时间
            int result = 0;

            //判断用户
            if (objRec.PostId != 0)//修改操作
            {
                result = new BLL.RecruitmentManager().ModifyRecruiment(objRec);
                if (result > 0)//修改成功
                {
                    return(Content("<script>alert('修改招聘成功!');location.href='" + Url.Action("RecruitmentManagers") + "';</script>"));
                }
                else//修改失败
                {
                    return(Content("<script>alert('修改招聘失败!');location.href='" + Url.Action("RecruitmentManagers") + "';</script>"));
                }
            }
            else//新增操作
            {
                result = new BLL.RecruitmentManager().AddRecruitment(objRec);
                if (result > 0)//发布成功
                {
                    return(Content("<script>alert('发布招聘成功!');location.href='" + Url.Action("RecruitmentPublish") + "';</script>"));
                }
                else//发布失败
                {
                    return(Content("<script>alert('发布招聘失败!');location.href='" + Url.Action("RecruitmentPublish") + "';</script>"));
                }
            }
        }
コード例 #2
0
        public ActionResult ZhaoPinDetail(string PostId)
        {
            //调用BLL业务逻辑方法,根据ID查看详情
            Recruitment objRec = new BLL.RecruitmentManager().GetPostById(PostId);

            //返回视图,将模型数据传递到视图中
            return(View("ZhaoPinDetail", objRec));
        }
コード例 #3
0
        public ActionResult DelPost(string postId)
        {
            //调用BLL层业务逻辑的删除方法
            int resutl = new BLL.RecruitmentManager().DeleteRecruiment(postId);

            if (resutl > 0)//删除成功
            {
                return(Content("<script>alert('删除成功!');location.href='" + Url.Action("RecruitmentManagers") + "';</script>"));
            }
            else//删除失败
            {
                return(Content("<script>alert('删除失败!');location.href='" + Url.Action("RecruitmentManagers") + "';</script>"));
            }
        }