예제 #1
0
        public async Task <IActionResult> PutApplyJob(int id, ApplyJob applyJob)
        {
            if (id != applyJob.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public ActionResult ApplyJob(JobDetailModel model)
        {
            var alert = HtmlHelper.Vertex().Alert();

            if (string.IsNullOrEmpty(model.ApplyJob.Email))
            {
                return(Json(alert.Text("Email can not be emty.").Color(BootstrapColor.Warning).ToHtmlString(), JsonRequestBehavior.AllowGet));
            }

            if (ModelState.IsValid)
            {
                ApplyJob applyJob = new ApplyJob();
                applyJob.FullName     = model.ApplyJob.FullName;
                applyJob.Email        = model.ApplyJob.Email;
                applyJob.Phone        = model.ApplyJob.Phone;
                applyJob.Message      = model.ApplyJob.Message;
                applyJob.JobId        = model.ApplyJob.JobId;
                applyJob.ApplyDateUtc = DateTime.UtcNow;
                applyJob.IsActive     = true;

                var result = applyJobService.Save(applyJob);
                if (result)
                {
                    return(Json(alert.Text("Thank you, your email successfully added.").Color(BootstrapColor.Success).ToHtmlString(), JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(alert.Text("Something is wrong, please try again.").Color(BootstrapColor.Danger).ToHtmlString(), JsonRequestBehavior.AllowGet));
        }
        public ActionResult ApplyJob(ApplyJob applyJob)
        {
            if (Session["FreelancerId"] == null)
            {
                return(Redirect("~/Home/Index"));
            }
            applyJob.FreelancerId = Convert.ToInt32(Session["FreelancerId"]);
            if (ModelState.IsValid)
            {
                try
                {
                    db.ApplyJobs.Add(applyJob);

                    int rowAffected = db.SaveChanges();
                    if (rowAffected > 0)
                    {
                        var result = db.Freelancers.SingleOrDefault(b => b.FreelancerId == applyJob.FreelancerId);
                        result.TotalConnect += -1;
                        db.SaveChanges();
                        ViewBag.ApplyConfirmMsg = "Successfully done. Client will contact with you soon.";
                        return(View());
                    }
                    ViewBag.ApplyConfirmMsg = "You may submit a proposal before.";
                    return(View());
                }
                catch (Exception)
                {
                    ViewBag.ApplyConfirmMsg = "You may submit a proposal before.";
                    return(View());
                }
            }

            return(View());
        }
예제 #4
0
        public ActionResult Apply(string message)
        {
            var userid = User.Identity.GetUserId();
            var jobid  = (int)Session["jobid"];
            var job    = new ApplyJob();

            var check = db.ApplyJobs.Where(a => a.jobid == jobid && a.userid == userid).ToList();

            if (check.Count < 1)
            {
                job.jobid     = jobid;
                job.userid    = userid;
                job.message   = message;
                job.ApplyTime = DateTime.Now;

                db.ApplyJobs.Add(job);
                db.SaveChanges();

                ViewBag.result = "The Job Added Successfully";

                return(View());
            }
            else
            {
                ViewBag.result = "Sorry The Job Added Before";

                return(View());
            }
        }
예제 #5
0
        public ActionResult ApplyJob(ApplyJob notice)
        {
            notice.FileName = Path.GetFileNameWithoutExtension(notice.Files.FileName);
            notice.FilePath = notice.FileName + System.IO.Path.GetExtension(notice.Files.FileName);
            string fileName = "~/NoticeFiles/" + notice.FileName + System.IO.Path.GetExtension(notice.Files.FileName);

            notice.Files.SaveAs(Server.MapPath(fileName));
            try
            {
                if (ModelState.IsValid)
                {
                    if (notice.ApplayJob())
                    {
                        ViewBag.Message = "Publish successfully";
                        ModelState.Clear();
                    }
                    else
                    {
                        ViewBag.Message = "Sorry! try again.";
                    }
                    return(View());
                }
                return(View());
            }
            catch
            {
                return(View());
            }
        }
예제 #6
0
        public async Task <ActionResult <ApplyJob> > PostApplyJob(ApplyJob applyJob)
        {
            _context.applyJobs.Add(applyJob);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetApplyJob", new { id = applyJob.Id }, applyJob));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            ApplyJob applyjob = db.ApplyJobs.Find(id);

            db.ApplyJobs.Remove(applyjob);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #8
0
 public IActionResult PostApplyJob([FromBody] ApplyJob applyJobs)
 {
     if (applyJobs == null)
     {
         return(BadRequest("ApplyJob is null!!!!!"));
     }
     _repository.Add(applyJobs);
     return(CreatedAtRoute("GetApplyJob", new { Id = applyJobs.ApplyJobID }, applyJobs));
 }
예제 #9
0
        public IActionResult GetApplyJobById(long applyJobsId)
        {
            ApplyJob applyJobs = _repository.Get(applyJobsId);

            if (applyJobs == null)
            {
                return(NotFound("ApplyJob record Not Found !!!"));
            }
            return(Ok(applyJobs));
        }
예제 #10
0
 public JsonResult Save(ApplyJob job)
 {
     if (ApplyJobBz.Save(job))
     {
         return(Json(new { IsSuccess = true, Msg = "提交成功!" }));
     }
     else
     {
         return(Json(new { IsSuccess = false, Msg = "提交失败!" }));
     }
 }
예제 #11
0
        public IActionResult DeleteApplyJob(long applyJobsId)
        {
            ApplyJob applyJobs = _repository.Get(applyJobsId);

            if (applyJobs == null)
            {
                return(NotFound("ApplyJob Record not Found!!!!"));
            }
            _repository.Delete(applyJobs);
            return(GetApplyJob());
        }
예제 #12
0
 public ActionResult Edit(ApplyJob job)
 {
     if (ModelState.IsValid)
     {
         job.ApplyTime       = DateTime.Now;
         db.Entry(job).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("GetJobsByUser"));
     }
     return(View(job));
 }
 public ActionResult Edit([Bind(Include = "ApplyId,JobID,StudentID,Skills")] ApplyJob applyjob)
 {
     if (ModelState.IsValid)
     {
         db.Entry(applyjob).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.JobID     = new SelectList(db.Jobs, "JobID", "CompanyName", applyjob.JobID);
     ViewBag.StudentID = new SelectList(db.tbl_Student, "StudentID", "FirstName", applyjob.StudentID);
     return(View(applyjob));
 }
예제 #14
0
        public IHttpActionResult PostApplyJob(ApplyJob applyJob)
        {
            var jobapplynow = db.JobLists.Where(x => x.JobListID == applyJob.JobListID).SingleOrDefault();

            var persondetails = db.ApplyJobs.Where(x => x.PersonalDetailID == applyJob.PersonalDetailID).SingleOrDefault(x => x.JobListID == applyJob.JobListID);

            if (persondetails == null && jobapplynow.LastDateofApplication >= DateTime.Now)
            {
                _repository.Post(applyJob);
            }

            return(Ok(persondetails));
        }
예제 #15
0
 public bool Save(ApplyJob applyJob)
 {
     if (applyJob.Id > 0)
     {
         cacheManager.Remove(CacheConstant.JOB_ITEM_APPLY_JOBS.FormatInvariant(applyJob.JobId));
         return(applyJobRepository.Update(applyJob));
     }
     else
     {
         cacheManager.Remove(CacheConstant.JOB_ITEM_APPLY_JOBS.FormatInvariant(applyJob.JobId));
         return(applyJobRepository.Insert(applyJob));
     }
 }
        // GET: Applyjobs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ApplyJob applyjob = db.ApplyJobs.Find(id);

            if (applyjob == null)
            {
                return(HttpNotFound());
            }
            return(View(applyjob));
        }
        protected void grdJobs_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ApplyJob")
            {
                int      JobID = Convert.ToInt32(e.CommandArgument.ToString());
                ApplyJob job   = new ApplyJob();
                job.JobID       = JobID;
                job.JobSeekerId = Convert.ToInt32(Session["JobseekerID"].ToString());
                job.Status      = 1;

                job.ApplyJobs(job);
                GetAllJobs();
            }
        }
        // GET: Applyjobs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ApplyJob applyjob = db.ApplyJobs.Find(id);

            if (applyjob == null)
            {
                return(HttpNotFound());
            }
            ViewBag.JobID     = new SelectList(db.Jobs, "JobID", "CompanyName", applyjob.JobID);
            ViewBag.StudentID = new SelectList(db.tbl_Student, "StudentID", "FirstName", applyjob.StudentID);
            return(View(applyjob));
        }
예제 #19
0
        public IActionResult PutApplyJob(long applyJobsId, [FromBody] ApplyJob applyJobs)
        {
            if (applyJobs == null)
            {
                return(BadRequest("Apply Jobs is null!!!!"));
            }

            ApplyJob applyJobsToUpdate = _repository.Get(applyJobsId);

            if (applyJobsToUpdate == null)
            {
                return(NotFound("Apply Jobs Record Not Found"));
            }
            _repository.Update(applyJobsToUpdate, applyJobs);
            return(CreatedAtRoute("GetApplyJob", new { Id = applyJobs.ApplyJobID }, applyJobs));
        }
예제 #20
0
        public ActionResult CreateApplyJob(ApplyJob applyJobToCreate)
        {
            try
            {
                ViewBag.JobId = applyJobToCreate.JobId;

                if (ModelState.IsValid)
                {
                    if (Request.Files.Count > 0)
                    {
                        var file = Request.Files[0];
                        applyJobToCreate.EmployeeCv = file.FileName;
                        file.SaveAs(Path.Combine(Server.MapPath("~/Content/CV"), applyJobToCreate.EmployeeCv));

                        //candidate.JobTitle
                        //candidate.Mail

                        // Database  / Mail
                        _uow.ApplyJobs.Add(applyJobToCreate);
                        _uow.Save();
                        ViewBag.Message = "Your Application has been sent Successfully!";
                        ViewBag.Status  = "success";
                        return(View("CreateApplyJob"));
                    }
                    else
                    {
                        ViewBag.Message = "Please select your CV!";
                        ViewBag.Status  = "danger";
                        return(View("CreateApplyJob", applyJobToCreate));
                    }
                }
                else
                {
                    ViewBag.Message = "Please, correct your info , and try again !";
                    ViewBag.Status  = "danger";
                    return(View("CreateApplyJob", applyJobToCreate));
                }
            }
            catch (Exception)
            {
                ViewBag.Message = "We cann't send your message , please try again";
                ViewBag.Status  = "danger";
                return(View("CreateApplyJob", applyJobToCreate));
            }
        }
예제 #21
0
        /// <summary>
        /// 拒绝简历操作
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="companyId"></param>
        /// <returns></returns>
        public bool Refuse(int uid, int companyId, int jobId)
        {
            ApplyJob update = db.ApplyJob.Where(o => o.Uid == uid)
                              .Where(o => o.CompanyId == companyId)
                              .Where(o => o.JobId == jobId)
                              .Where(o => o.Status == 0)
                              .FirstOrDefault();

            update.Status = 3;
            try
            {
                db.SaveChanges();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
예제 #22
0
        public async Task <IActionResult> Apply(Apply apply, string General, string Status)
        {
            ViewBag.City           = new SelectList(_context.Cities.ToList(), "Id", "CityName").Take(3);
            ViewBag.State          = new SelectList(_context.States.ToList(), "Id", "StateName");
            ViewBag.Country        = new SelectList(_context.Countries.ToList(), "Id", "CountryName");
            ViewBag.EducationLevel = new SelectList(_context.EducationLevels.ToList(), "Id", "Level");
            ViewBag.Location       = new SelectList(_context.Loactions.ToList(), "Id", "Locationn");
            ViewBag.Category       = new SelectList(_context.Categories.ToList(), "Id", "CategoryName");
            if (!ModelState.IsValid)
            {
                return(View());
            }



            var user = await _userManager.FindByNameAsync(User.Identity.Name);


            ApplyJob applyJob = new ApplyJob
            {
                JobId     = Convert.ToInt32(TempData["jobId"].ToString()),
                AppUserId = user.Id,
            };

            _context.ApplyJobs.Add(applyJob);



            if (ModelState["Photo"].ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid)
            {
                return(View());
            }

            if (!apply.Photo.IsImage())
            {
                ModelState.AddModelError("Photo", "Shekilin olchusu max 1mg ola biler");
                return(View());
            }

            if (apply.Photo.MaxLength(1000))
            {
                ModelState.AddModelError("Photo", "Shekilin olchusu max 1mg ola biler");
                return(View());
            }

            string path     = Path.Combine("images", "apply");
            string fileName = await apply.Photo.SaveImg(_env.WebRootPath, path);

            Apply newApply = new Apply
            {
                Firstname             = apply.Firstname,
                MiddleName            = apply.MiddleName,
                Surname               = apply.Surname,
                Date                  = apply.Date,
                General               = General,
                Status                = Status,
                Phone                 = apply.Phone,
                Email                 = apply.Email,
                Website               = apply.Website,
                Address               = apply.Address,
                CityId                = apply.CityId,
                StateId               = apply.StateId,
                CountryId             = apply.CountryId,
                GraduationDate        = apply.GraduationDate,
                StartUniversity       = apply.StartUniversity,
                UniversityName        = apply.UniversityName,
                Degree                = apply.Degree,
                CourseTitle           = apply.CourseTitle,
                EducationInformation  = apply.EducationInformation,
                EducationLevelId      = apply.EducationLevelId,
                CompanyName           = apply.CompanyName,
                JobPosition           = apply.JobPosition,
                StartCompanyDate      = apply.StartCompanyDate,
                EndCompanyDate        = apply.EndCompanyDate,
                ExperienceInformation = apply.ExperienceInformation,
                LocationId            = apply.LocationId,
                Skills                = apply.Skills,
                AboutMe               = apply.AboutMe,
                Instagram             = apply.Instagram,
                Facebook              = apply.Facebook,
                Twitter               = apply.Twitter,
                Google                = apply.Google,
                CategoryId            = apply.CategoryId,
                AppUserId             = TempData["userId"].ToString(),
                JobTitle              = TempData["jobTitle"].ToString(),
            };

            newApply.Image = fileName;

            await _context.Applies.AddAsync(newApply);

            await _context.SaveChangesAsync();

            return(RedirectToAction("Index", "Home"));
        }
예제 #23
0
 public bool Delete(ApplyJob applyJob)
 {
     return(applyJobRepository.Delete(applyJob));
 }
예제 #24
0
 public IHttpActionResult UpdateApplyJob(int applyjobId, ApplyJob applyJob)
 {
     _repository.Put(applyjobId, applyJob);
     return(CreatedAtRoute("GetJobApply", new { Id = applyJob.ApplyJobID }, applyJob));
 }
예제 #25
0
 public IHttpActionResult CancelApplyJob(int applyjobId, ApplyJob applyJob)
 {
     _repository.Delete(applyjobId);
     return(CreatedAtRoute("GetJobApply", new { Id = applyJob.ApplyJobID }, applyJob));
 }