Ejemplo n.º 1
0
        public async Task <IHttpActionResult> Putseeker_profile(int id, seeker_profile seeker_profile)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != seeker_profile.user_account_id)
            {
                return(BadRequest());
            }

            db.Entry(seeker_profile).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> Postseeker_profile(seeker_profile seeker_profile)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.seeker_profile.Add(seeker_profile);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (seeker_profileExists(seeker_profile.user_account_id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = seeker_profile.user_account_id }, seeker_profile));
        }
Ejemplo n.º 3
0
        public async Task <IHttpActionResult> Deleteseeker_profile(int id)
        {
            seeker_profile seeker_profile = await db.seeker_profile.FindAsync(id);

            if (seeker_profile == null)
            {
                return(NotFound());
            }

            db.seeker_profile.Remove(seeker_profile);
            await db.SaveChangesAsync();

            return(Ok(seeker_profile));
        }
Ejemplo n.º 4
0
        public void seeker_profileTest()
        {
            seeker_profile _seeker_profile = new seeker_profile()
            {
                currency            = "",
                current_salary      = 1,
                first_name          = "",
                last_name           = "",
                is_annually_monthly = "1",
                user_account        = new user_account()
                {
                    id                        = 1,
                    contact_number            = 123456,
                    date_of_birth             = DateTime.Now,
                    email                     = "*****@*****.**",
                    email_notification_active = "1",
                    gender                    = "0",
                    is_active                 = "1",
                    password                  = "******",
                    registration_date         = DateTime.Now,
                    sms_notification_active   = "1",
                    user_type_id              = 1,
                    user_type                 = new user_type()
                    {
                        id             = 1,
                        user_type_name = "seeker"
                    },
                    user_log = new user_log()
                    {
                        last_job_apply_date = DateTime.Now,
                        user_account_id     = 1,
                        last_login_date     = DateTime.Now,
                    }
                },
            };

            _seeker_profile.education_detail.Add(new education_detail()
            {
                certificate_degree_name = "",
                cgpa                      = 100,
                completion_date           = DateTime.Now,
                institute_university_name = "",
                major                     = "",
                percentage                = 100,
                starting_date             = DateTime.Now,
                user_account_id           = 1,
                seeker_profile            = _seeker_profile
            });
            _seeker_profile.experience_detail.Add(new experience_detail()
            {
                user_account_id      = 1,
                is_current_job       = "1",
                start_date           = DateTime.Now,
                end_date             = DateTime.Now,
                job_title            = "loltitle",
                company_name         = "lolcompany",
                job_location_city    = "dfjyjy",
                job_location_country = "stsrtj",
                job_location_state   = "asthsrth",
                seeker_profile       = _seeker_profile,
                description          = "dhjdkdtuk" +
                                       "dtuksdsddtk" +
                                       "dykdk"
            });
            _seeker_profile.seeker_skill_set.Add(new seeker_skill_set()
            {
                seeker_profile = _seeker_profile,
                skill_level    = 5,
                skill_set      = new skill_set()
                {
                    id             = 1,
                    skill_set_name = "skill name"
                },
                skill_set_id    = 1,
                user_account_id = 1
            });

            Xunit.Assert.NotNull(_seeker_profile);
        }