Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name_of_candidate,DOB_of_candidate,Mobile_no_of_candidate,Email_address_of_candidate")] Candidate_Detail candidate_Detail)
        {
            if (id != candidate_Detail.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(candidate_Detail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Candidate_DetailExists(candidate_Detail.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate_Detail));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Name_of_candidate,DOB_of_candidate,Mobile_no_of_candidate,Email_address_of_candidate")] Candidate_Detail candidate_Detail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(candidate_Detail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate_Detail));
        }
Ejemplo n.º 3
0
        // POST: odata/Candidate_Detail
        public IHttpActionResult Post(Candidate_Detail candidate_Detail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Candidate_Details.Add(candidate_Detail);
            db.SaveChanges();

            return(Created(candidate_Detail));
        }
Ejemplo n.º 4
0
        // DELETE: odata/Candidate_Detail(5)
        public IHttpActionResult Delete([FromODataUri] int key)
        {
            Candidate_Detail candidate_Detail = db.Candidate_Details.Find(key);

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

            db.Candidate_Details.Remove(candidate_Detail);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Candidate_Detail = await _context.Candidate_Detail.FirstOrDefaultAsync(m => m.Id == id);

            if (Candidate_Detail == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Candidate_Detail = await _context.Candidate_Detail.FindAsync(id);

            if (Candidate_Detail != null)
            {
                _context.Candidate_Detail.Remove(Candidate_Detail);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Ejemplo n.º 7
0
        // PUT: odata/Candidate_Detail(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Candidate_Detail> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Candidate_Detail candidate_Detail = db.Candidate_Details.Find(key);

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

            patch.Put(candidate_Detail);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Candidate_DetailExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(candidate_Detail));
        }