Example #1
0
        public async Task <IHttpActionResult> PutJobSeeker(int jobSeekerId, JobSeeker jobSeeker)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (jobSeekerId != jobSeeker.ID)
            {
                return(BadRequest());
            }
            await bll.UpdateJobSeeker(jobSeeker);

            /* db.Entry(jobSeeker).State = EntityState.Modified;
             *
             * try
             * {
             *   await db.SaveChangesAsync();
             * }
             * catch (DbUpdateConcurrencyException)
             * {
             *   if (!JobSeekerExists(id))
             *   {
             *       return NotFound();
             *   }
             *   else
             *   {
             *       throw;
             *   }
             * }*/

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,FirstName,LastName,Email,PhoneNo,IsFemale,Birthday")] JobSeeker jobSeeker)
        {
            if (ModelState.IsValid)
            {
                await bll.UpdateJobSeeker(jobSeeker);

                return(RedirectToAction("Index"));
            }
            return(View(jobSeeker));
        }