コード例 #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
        /// <summary>
        /// 投递简历.
        /// </summary>
        /// <param name="userId">用户.</param>
        /// <param name="recruitmentId">招聘信息.</param>
        /// <returns>Json.</returns>
        public ActionResult Deliver(int userId, int recruitmentId, int companyId)
        {
            if (Db.Queryable <Notice>().Where(it => it.SourceId == userId && it.TargetId == companyId && it.Type == "简历投递").Single() != null)
            {
                return(Json(new { code = 400 }, JsonRequestBehavior.AllowGet));
            }

            Record record = new Record
            {
                SeekerId      = userId,
                RecruitmentId = recruitmentId,
                Time          = DateTime.Now.ToString(),
            };

            Db.Insertable(record).ExecuteReturnIdentity();

            Seeker      seeker      = Db.Queryable <Seeker>().Where(it => it.Id == userId).Single();
            Recruitment recruitment = Db.Queryable <Recruitment>().Where(it => it.Id == recruitmentId).Single();
            Notice      notice      = new Notice
            {
                SourceId = userId,
                TargetId = companyId,
                Time     = DateTime.Now.ToString(),
                Content  = seeker.Name + (seeker.Sex == "男"?"先生":"女士") + "-投递贵司-" + recruitment.Offer + "岗位,详情内容请查看简历邮箱",
                Type     = "简历投递",
                IsReply  = 0,
            };

            Db.Insertable(notice).ExecuteReturnIdentity();

            return(Json(new { code = 200 }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
 /// <summary>
 /// 新建招聘.
 /// </summary>
 /// /// <param name="recruit">传入数据.</param>
 /// <returns>Json.</returns>
 public ActionResult AddRecruit(Recruitment recruit)
 {
     // 自增列用法
     recruit.Time = DateTime.Now.ToString();
     Db.Insertable(recruit).ExecuteReturnIdentity();
     return(Json(new { code = 200 }, JsonRequestBehavior.AllowGet));
 }
コード例 #4
0
ファイル: GamesSeeder.cs プロジェクト: AJMitev/Footballize
        private void SeedRecruitments(FootballizeDbContext dbContext, User user, List <Pitch> fields)
        {
            var games = new List <Recruitment>();

            for (int i = 2; i <= 10; i++)
            {
                var index = i % 2 == 0 ? 1 : 0;

                var game = new Recruitment
                {
                    Title          = $"Need {i} players",
                    Pitch          = fields[index],
                    Creator        = user,
                    StartingAt     = DateTime.Now.AddDays(2),
                    MaximumPlayers = i,
                };

                games.Add(game);
            }

            foreach (var game in games)
            {
                if (!dbContext.Recruitments.Any(x => x.Title == game.Title))
                {
                    dbContext.Recruitments.Add(game);
                }
            }
        }
コード例 #5
0
        public ActionResult AddCreat(Recruitment rec)
        {
            rec.PublishTime = DateTime.Now;
            int res = manager.AddRecruitment(rec);

            return(Content(res.ToString()));
        }
コード例 #6
0
        public ActionResult UpdateRecruitment(Recruitment rec)
        {
            rec.PublishTime = DateTime.Now;
            int res = manager.ModifyRecruitment(rec);

            return(Content(res.ToString()));
        }
コード例 #7
0
        public async Task <ActionResult <Recruitment> > PostRecruitment(Recruitment recruitment)
        {
            _context.Recruitments.Add(recruitment);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRecruitment", new { id = recruitment.id }, recruitment));
        }
コード例 #8
0
        public async Task <IActionResult> PutRecruitment(int id, Recruitment recruitment)
        {
            if (id != recruitment.id)
            {
                return(BadRequest());
            }

            _context.Entry(recruitment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RecruitmentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #9
0
        // GET: Recruitment/Create
        public ActionResult Create(long?id)
        {
            if (id == null)
            {
                Recruitment recr = new Recruitment();
                recr.Id = Utils.Utils.GenerateJobOfferId();

                return(View("CreateAndShow", recr));
            }
            else
            {
                Recruitment recr = new Recruitment()
                {
                    Id        = (long)id,
                    JobOffer  = dao.GetJobOfferByOfferNumber((long)id),
                    StartTime = DateTime.Now,
                    Candidate = new List <Candidate>(),
                    Events    = new List <RecruitmentEvent>(),
                    EndTime   = DateTime.MaxValue,
                };
                RecruitmentEvent ev = new RecruitmentEvent()
                {
                    Event       = "Rozpoczęcie rekrutacji",
                    Time        = DateTime.Now,
                    Author      = "HR Manager",
                    AuthorId    = "HR Manager",
                    Recruitment = recr,
                };

                ((List <RecruitmentEvent>)recr.Events).Add(ev);
                dao.SaveRecruitment(recr);

                return(View("CreateAndShow", recr));
            }
        }
コード例 #10
0
        public ActionResult DoRecruitment(Recruitment objRec)
        {
            objRec.PublishTime = DateTime.Now;
            int res = 0;

            if (objRec.PostId != 0)
            {
                res = new RecruitmentManager().ModifyRecruiment(objRec);
                if (res > 0)
                {
                    return(Content("<script>alert('修改招聘成功!');location.href='" + Url.Action("RecruitmentPublish") + "'</script>"));
                }
                else
                {
                    return(Content("<script>alert('修改招聘失败!');location.href='" + Url.Action("RecruitmentPublish") + "'</script>"));
                }
            }
            else
            {
                //调用BLL(缺少了验证)
                res = new RecruitmentManager().AddRecruitment(objRec);
                if (res > 0)
                {
                    return(Content("<script>alert('发布招聘成功!');location.href='" + Url.Action("RecruitmentPublish") + "'</script>"));
                }
                else
                {
                    return(Content("<script>alert('发布招聘失败!');location.href='" + Url.Action("RecruitmentPublish") + "'</script>"));
                }
            }
        }
コード例 #11
0
 internal Character() : base(EntityType.Character)
 {
     BattleInfo  = new BattleInfo();
     Recruitment = new Recruitment();
     Units       = new List <IUnit>();
     Carrying    = new List <IObject>();
 }
コード例 #12
0
        /// <summary>
        /// Add recruitment information
        /// </summary>
        /// <param name="objRecruitment"></param>
        /// <returns></returns>
        public int AddRecruitmentInfo(Recruitment objRecruitment)
        {
            string sql =
                "INSERT INTO [dbo].[Recruitment] (PostName, PostPlace, RequireCount, PostType, EduBackground, PostDesc, PostRequire, Experience, PublishTime, Manager, PhoneNumber, Email) VALUES (@PostName, @PostPlace, @RequireCount, @PostType, @EduBackground, @PostDesc, @PostRequire, @Experience, @PublishTime, @Manager, @PhoneNumber, @Email)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@PostName", objRecruitment.PostName),
                new SqlParameter("@PostPlace", objRecruitment.PostPlace),
                new SqlParameter("@RequireCount", objRecruitment.RequireCount),
                new SqlParameter("@PostType", objRecruitment.PostType),
                new SqlParameter("@EduBackground", objRecruitment.EduBackground),
                new SqlParameter("@PostDesc", objRecruitment.PostDesc),
                new SqlParameter("@PostRequire", objRecruitment.PostRequire),
                new SqlParameter("@Experience", objRecruitment.Experience),
                new SqlParameter("@PublishTime", objRecruitment.PublishTime),
                new SqlParameter("@Manager", objRecruitment.Manager),
                new SqlParameter("@PhoneNumber", objRecruitment.PhoneNumber),
                new SqlParameter("@Email", objRecruitment.Email)
            };

            int result = SQLHelper.Update(sql, param);

            return(result);
        }
コード例 #13
0
        /// <summary>
        /// 根据发布编号查询详细职位信息
        /// </summary>
        /// <param name="postId"></param>
        /// <returns></returns>
        public Recruitment GetPostById(string postId)
        {
            string      sql    = "SELECT * FROM Recruitment WHERE PostId=@PostId";
            Recruitment objRec = null;

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@PostId", postId)
            };
            SqlDataReader objReader = SQLHelper.GetReader(sql, param);

            if (objReader.Read())
            {
                objRec = new Recruitment()
                {
                    PostId        = Convert.ToInt32(objReader["PostId"]),
                    PostName      = objReader["PostName"].ToString(),
                    PostPlace     = objReader["PostPlace"].ToString(),
                    RequireCount  = Convert.ToInt32(objReader["RequireCount"]),
                    PostType      = objReader["PostType"].ToString(),
                    PostDesc      = objReader["PostDesc"].ToString(),
                    PostRequire   = objReader["PostRequire"].ToString(),
                    Experience    = objReader["Experience"].ToString(),
                    EduBackground = objReader["EduBackground"].ToString(),
                    Manager       = objReader["Manager"].ToString(),
                    PhoneNumber   = objReader["PhoneNumber"].ToString(),
                    Email         = objReader["Email"].ToString(),
                    PublishTime   = Convert.ToDateTime(objReader["PublishTime"])
                };
            }
            objReader.Close();
            return(objRec);
        }
コード例 #14
0
ファイル: RecruitmentsController.cs プロジェクト: jump720/MMS
        public async Task <ActionResult> Create(Recruitment model)
        {
            if (ModelState.IsValid)
            {
                model.Estado       = EstadoFormatoPQRS.Open;
                model.CreationDate = DateTime.Now;

                db.Recruitments.Add(model);
                await db.SaveChangesAsync();

                AddLog("", model.RecruitmentId, model);
                return(RedirectToAction("Index", GetReturnSearch()));
            }

            ViewBag.UsuarioIdSubstitute  = new SelectList(db.Usuarios, "UsuarioId", "UsuarioNombre", model.UsuarioIdSubstitute);
            ViewBag.AreaManagerID        = new SelectList(db.Usuarios, "UsuarioId", "UsuarioNombre", model.AreaManagerID);
            ViewBag.HumanResourcesID     = new SelectList(db.Usuarios, "UsuarioId", "UsuarioNombre", model.HumanResourcesID);
            ViewBag.ImmediateBossID      = new SelectList(db.Usuarios, "UsuarioId", "UsuarioNombre", model.ImmediateBossID);
            ViewBag.CentroCostoID        = new SelectList(db.CentroCostos, "CentroCostoID", "CentroCostoDesc", model.CentroCostoID);
            ViewBag.ProposedCostCenterID = new SelectList(db.CentroCostos, "CentroCostoID", "CentroCostoDesc", model.ProposedCostCenterID);
            ViewBag.DepartmentId         = new SelectList(db.Area, "Id", "Nombre", model.DepartmentId);
            ViewBag.ProposedDepartmentId = new SelectList(db.Area, "Id", "Nombre", model.ProposedDepartmentId);

            var sectors = from Sectors d in Enum.GetValues(typeof(Sectors))
                          select new { ID = (int)d, Name = d.ToString() };

            var positions = from Positions d in Enum.GetValues(typeof(Positions))
                            select new { ID = (int)d, Name = d.ToString() };

            var contractTypes = from ContractTypes d in Enum.GetValues(typeof(ContractTypes))
                                select new { ID = (int)d, Name = d.ToString() };

            var budgets = from Budgets d in Enum.GetValues(typeof(Budgets))
                          select new { ID = (int)d, Name = d.ToString() };

            var resignationReasons = from ResignationReasons d in Enum.GetValues(typeof(ResignationReasons))
                                     select new { ID = (int)d, Name = d.ToString() };

            var previousNotices = from PreviousNotices d in Enum.GetValues(typeof(PreviousNotices))
                                  select new { ID = (int)d, Name = d.ToString() };

            var experienceTimes = from ExperienceTimes d in Enum.GetValues(typeof(ExperienceTimes))
                                  select new { ID = (int)d, Name = d.ToString() };

            ViewBag.Sector            = new SelectList(sectors, "ID", "Name", model.Sector);
            ViewBag.Position          = new SelectList(positions, "ID", "Name", model.Position);
            ViewBag.ContractType      = new SelectList(contractTypes, "ID", "Name", model.ContractType);
            ViewBag.Budget            = new SelectList(budgets, "ID", "Name", model.Budget);
            ViewBag.ResignationReason = new SelectList(resignationReasons, "ID", "Name", model.ResignationReason);
            ViewBag.PreviousNotice    = new SelectList(previousNotices, "ID", "Name", model.PreviousNotice);
            ViewBag.ExperienceTime    = new SelectList(experienceTimes, "ID", "Name", model.ExperienceTime);

            Seguridadcll seguridadcll = (Seguridadcll)Session["seguridad"];

            ViewBag.UsuarioNombre = seguridadcll.Usuario.UsuarioId + " - " + seguridadcll.Usuario.UsuarioNombre;
            ViewBag.UsuarioId     = seguridadcll.Usuario.UsuarioId;
            ViewBag.MotivoPQRS    = await db.MotivosPQRS.Where(m => m.TipoPQRS == TipoPQRS.Recruitment && m.Activo == true).ToListAsync();

            return(View(model));
        }
コード例 #15
0
        /// <summary>
        /// 查询所有职位列表信息
        /// </summary>
        /// <returns></returns>
        public List <Recruitment> GetAllRecList()
        {
            string    sql = "SELECT *  FROM Recruitment";
            DataTable dt  = SQLHelper.GetTable(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <Recruitment> objList = new List <Recruitment>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Recruitment model = new Recruitment();
                    model.PostId        = Convert.ToInt32(dt.Rows[i]["PostId"].ToString());
                    model.PostName      = dt.Rows[i]["PostName"].ToString();
                    model.EduBackground = dt.Rows[i]["EduBackground"].ToString();
                    model.Email         = dt.Rows[i]["Email"].ToString();
                    model.Experience    = dt.Rows[i]["Experience"].ToString();
                    model.Manager       = dt.Rows[i]["Manager"].ToString();
                    model.PhoneNumber   = dt.Rows[i]["PhoneNumber"].ToString();
                    model.PostDesc      = dt.Rows[i]["PostDesc"].ToString();
                    model.PostPlace     = dt.Rows[i]["PostPlace"].ToString();
                    model.PostRequire   = dt.Rows[i]["PostRequire"].ToString();
                    model.PostType      = dt.Rows[i]["PostType"].ToString();
                    model.PublishTime   = Convert.ToDateTime(dt.Rows[i]["PublishTime"]);
                    model.RequireCount  = Convert.ToInt32(dt.Rows[i]["RequireCount"]);
                    objList.Add(model);
                }
                return(objList);
            }
            return(null);
        }
コード例 #16
0
        public ActionResult RecruitmentManager()
        {
            IList <Recruitment> list            = RecruitmentBLL.GetAll();
            List <Recruitment>  recruitmentlist = new List <Recruitment>();

            foreach (var temp in list)
            {
                Recruitment recruitment = new Recruitment();
                recruitment.PostId        = temp.PostId;
                recruitment.PostName      = temp.PostName;
                recruitment.PostType      = temp.PostType;
                recruitment.PostPlace     = temp.PostPlace;
                recruitment.PostDesc      = temp.PostDesc;
                recruitment.PostRequire   = temp.PostRequire;
                recruitment.Experience    = temp.Experience;
                recruitment.EduBackground = temp.EduBackground;
                recruitment.RequireCount  = temp.RequireCount;
                recruitment.PublishTime   = temp.PublishTime;
                recruitment.Manager       = temp.Manager;
                recruitment.PhoneNumber   = temp.PhoneNumber;
                recruitment.Email         = temp.Email;
                recruitmentlist.Add(recruitment);
            }
            ViewData["RecruitmentManager"] = recruitmentlist;
            return(View());
        }
コード例 #17
0
        /// <summary>
        /// 发布招聘信息
        /// </summary>
        /// <param name="objRecru"></param>
        /// <returns></returns>
        public int AddRecruitment(Recruitment objRecru)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("INSERT INTO Recruitment (PostName,PostType,PostPlace,PostDesc,");
            strsql.Append("PostRequire,Experience,EduBackground,RequireCount,Manager,PhoneNumber,Email)");
            strsql.Append("VALUES(@PostName,@PostType,@PostPlace,@PostDesc,");
            strsql.Append("@PostRequire,@Experience,@EduBackground,@RequireCount,");
            strsql.Append("@Manager,@PhoneNumber,@Email)");
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@PostName", objRecru.PostName),
                new SqlParameter("@PostType", objRecru.PostType),
                new SqlParameter("@PostPlace", objRecru.PostPlace),
                new SqlParameter("@PostDesc", objRecru.PostDesc),
                new SqlParameter("@PostRequire", objRecru.PostRequire),
                new SqlParameter("@EduBackground", objRecru.EduBackground),
                new SqlParameter("@Experience", objRecru.Experience),
                new SqlParameter("@RequireCount", objRecru.RequireCount),
                new SqlParameter("@Manager", objRecru.Manager),
                new SqlParameter("@PhoneNumber", objRecru.PhoneNumber),
                new SqlParameter("@Email", objRecru.Email)
            };
            return(SQLHelper.Update(strsql.ToString(), param));
        }
コード例 #18
0
ファイル: JobController.cs プロジェクト: tomfang678/SmartWeb
 public JsonResult GetJobList(int page, int pageSize)
 {
     JsonResult result = new JsonResult();
     Recruitment bll = new Recruitment();
     var t = bll.FindByPage(pageSize, page);
     return Json(t, JsonRequestBehavior.AllowGet);
 }
コード例 #19
0
 public Recruitment Add(Recruitment entity)
 {
     //entity.Slug = ServiceHelpers.CreateUrl(entity.Name.Trim());
     // url slug generator
     entity.Slug = ServiceHelpers.GenerateSlug(entity.Name, GetBySlugLike(ServiceHelpers.CreateUrl(entity.Name)), null);
     return(_context.Recruitment.Add(entity));
 }
コード例 #20
0
ファイル: MainViewModel.cs プロジェクト: solitas/JobHunting
        private void RecruitAdditionHandler(object param)
        {
            ViewMode = true;

            Recruitment newRecruitment = param as Recruitment;

            if (_isModify)
            {
                if (newRecruitment != null)
                {
                    _selectedRecruitment.Company       = newRecruitment.Company;
                    _selectedRecruitment.Site          = newRecruitment.Site;
                    _selectedRecruitment.StartDate     = newRecruitment.StartDate;
                    _selectedRecruitment.EndDate       = newRecruitment.EndDate;
                    _selectedRecruitment.RecruitType   = RecruitType;
                    _selectedRecruitment.ScreeningStep = ScreeningStep;
                }
                _isModify = false;
            }
            else
            {
                if (newRecruitment != null)
                {
                    newRecruitment.RecruitType   = RecruitType;
                    newRecruitment.ScreeningStep = ScreeningStep;
                    Recruitments.Add(newRecruitment);
                }
            }
            _repository.SaveRecruitments(_recruitments);
            NotifyPropertyChanged("Recruitments");
        }
コード例 #21
0
        public async Task <int> InsertAsync(Recruitment item)
        {
            var item_ = item;
            await _repository.AddAsync(item);

            return(item.Id);
        }
コード例 #22
0
        /// <summary>
        /// Modify recruitment information
        /// </summary>
        /// <param name="objRecruitment"></param>
        /// <returns></returns>
        public int ModifyRecruitmentInfo(Recruitment objRecruitment)
        {
            string sql =
                "UPDATE [dbo].[Recruitment] SET PostName = @PostName, PostPlace = @PostPlace, RequireCount = @RequireCount, PostType = @PostType, EduBackground = @EduBackground, PostDesc = @PostDesc, PostRequire = @PostRequire, Experience = @Experience, PublishTime = @PublishTime, Manager = @Manager, PhoneNumber = @PhoneNumber, Email = @Email WHERE PostId = @PostId";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@PostName", objRecruitment.PostName),
                new SqlParameter("@PostPlace", objRecruitment.PostPlace),
                new SqlParameter("@RequireCount", objRecruitment.RequireCount),
                new SqlParameter("@PostType", objRecruitment.PostType),
                new SqlParameter("@EduBackground", objRecruitment.EduBackground),
                new SqlParameter("@PostDesc", objRecruitment.PostDesc),
                new SqlParameter("@PostRequire", objRecruitment.PostRequire),
                new SqlParameter("@Experience", objRecruitment.Experience),
                new SqlParameter("@PublishTime", objRecruitment.PublishTime),
                new SqlParameter("@Manager", objRecruitment.Manager),
                new SqlParameter("@PhoneNumber", objRecruitment.PhoneNumber),
                new SqlParameter("@Email", objRecruitment.Email),
                new SqlParameter("@PostId", objRecruitment.PostId),
            };

            int result = SQLHelper.Update(sql, param);

            return(result);
        }
コード例 #23
0
        public IEnumerable <Recruitment> GetAll()
        {
            var recruitments = new List <Recruitment>();

            using (var con = new SqlConnection(SeletivoSettings.connectionString))
            {
                con.Open();

                using (var cmd = new SqlCommand("SELECT ID, DESCRIPTION, DATE FROM GA_RECRUITMENT", con))
                {
                    using (var reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var recruitment = new Recruitment
                            {
                                Id          = reader.GetInt32(0),
                                Description = reader["Description"].ToString(),
                                Date        = reader.GetDateTime(2)
                            };

                            recruitments.Add(recruitment);
                        }
                    }
                }
            }
            return(recruitments);
        }
コード例 #24
0
        public Recruitment Get(object id)
        {
            Recruitment recruitment = null;

            using (var con = new SqlConnection(SeletivoSettings.connectionString))
            {
                con.Open();

                using (var cmd = new SqlCommand("SELECT ID, DESCRIPTION, DATE FROM GA_RECRUITMENT WHERE ID = @id", con))
                {
                    cmd.Parameters.Add("id", SqlDbType.Int).Value = id;

                    using (var reader = cmd.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            recruitment = new Recruitment
                            {
                                Id          = reader.GetInt32(0),
                                Description = reader["Description"].ToString(),
                                Date        = reader.GetDateTime(3)
                            };
                        }
                    }
                }
            }
            return(recruitment);
        }
コード例 #25
0
        public ActionResult RecruitmentUpdate(int postId)
        {
            Recruitment recruitment = new Recruitment();

            recruitment = RecruitmentBLL.Get(o => o.PostId == postId);
            return(View(recruitment));
        }
コード例 #26
0
        public Recruitment CreateRecruitment([FromBody] Recruitment recruitment) //[FromBody]
        {
            recruitment.CreateTime = DateTime.Now;
            var entity = JianDb.Recruitment.Add(recruitment);

            JianDb.SaveChanges();
            return(entity);
        }
コード例 #27
0
        public ViewResult Publish(Recruitment recruitment)
        {
            DateTime time = DateTime.Now;

            recruitment.PublishTime = time;
            RecruitmentBLL.Create(recruitment);
            return(View("Index"));
        }
コード例 #28
0
 //添加招聘信息
 public int AddRecruitment(Recruitment rec)
 {
     using (HotelDBEntities db = new HotelDBEntities())
     {
         db.Entry <Recruitment>(rec).State = EntityState.Added;
         return(db.SaveChanges());
     }
 }
コード例 #29
0
        public ActionResult DeleteRecruitment(int postId)
        {
            Recruitment recruitments = new Recruitment();

            recruitments = RecruitmentBLL.Get(o => o.PostId == postId);
            RecruitmentBLL.Delete(recruitments);
            return(RedirectToAction("/RecruitmentManager"));
        }
コード例 #30
0
 /// <summary>
 /// 发布招聘信息
 /// </summary>
 /// <param name="recruitment"></param>
 /// <returns></returns>
 public int AddRecruitment(Recruitment recruitment)
 {
     using (HotelDBEntities db = new HotelDBEntities())
     {
         db.Recruitment.Add(recruitment);
         return(db.SaveChanges());
     }
 }
コード例 #31
0
        public ActionResult DeleteConfirmed(int id)
        {
            Recruitment recruitment = db.Recruitments.Find(id);

            db.Recruitments.Remove(recruitment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #32
0
ファイル: JobController.cs プロジェクト: tomfang678/SmartWeb
 public JsonResult Destroy(string models)
 {
     if (!string.IsNullOrEmpty(models))
     {
         var info = JsonConvert.DeserializeObject<List<sd_job>>(models);
         var t = new Recruitment().Delete(info);
         return Json(t);
     }
     return Json(false);
 }
コード例 #33
0
ファイル: JobController.cs プロジェクト: tomfang678/SmartWeb
 public ActionResult JobAdd()
 {
     if (Request["id"] != null)
     {
         ViewData["job"] = new Recruitment().Find(int.Parse(Request["id"].ToString()));
     }
     else
     {
         ViewData["job"] = null;
     }
     return View();
 }
コード例 #34
0
 public ActionResult Detail()
 {
     var id = Request.QueryString["id"];
     int pid = 0;
     var i = int.TryParse(id, out pid);
     if (!string.IsNullOrEmpty(id) && i)
     {
         var model = new Recruitment().Find(pid);
         ViewData["jobDetail"] = model;
     }
     return View();
 }
コード例 #35
0
 public JsonResult Get()
 {
     var list = new Recruitment().FindALL();
     return Json(list);
 }
コード例 #36
0
ファイル: JobController.cs プロジェクト: tomfang678/SmartWeb
 public ActionResult UpdateJob(string models)
 {
     sd_job info = new sd_job();
     if (models != null)
     {
         info = JsonConvert.DeserializeObject<sd_job>(models);
         info.addtime = DateTime.Now;
         var t = new Recruitment().Update(info);
         return Json(t);
     }
     return Json(false);
 }
コード例 #37
0
 //
 // GET: /Job/
 public ActionResult Index()
 {
     var list = new Recruitment().FindALL();
     ViewData["job"] = list;
     return View();
 }