コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ExamName,Subject,Institute,Board,PassingYear,Result,UserId,IsPublic")] AcademicQualification academicQualification)
        {
            if (id != academicQualification.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(academicQualification);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AcademicQualificationExists(academicQualification.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("AcademicQualification", "UserProfile", new { Messege = "Academic Qualification is Updated" }));
            }
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Id", academicQualification.UserId);
            return(View(academicQualification));
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            AcademicQualification academicQualification = db.AcademicQualifications.Find(id);

            db.AcademicQualifications.Remove(academicQualification);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,CreateBy,CreateDate,ModifyBy,ModifyDate")] AcademicQualification academicQualification)
 {
     if (ModelState.IsValid)
     {
         db.Entry(academicQualification).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(academicQualification));
 }
コード例 #4
0
        public ActionResult Create([Bind(Include = "Id,Name,CreateBy,CreateDate,ModifyBy,ModifyDate")] AcademicQualification academicQualification)
        {
            if (ModelState.IsValid)
            {
                db.AcademicQualifications.Add(academicQualification);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(academicQualification));
        }
コード例 #5
0
        // GET: AcademicQualifications/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AcademicQualification academicQualification = db.AcademicQualifications.Find(id);

            if (academicQualification == null)
            {
                return(HttpNotFound());
            }
            return(View(academicQualification));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("Id,ExamName,Subject,Institute,Board,PassingYear,Result,UserId,IsPublic")] AcademicQualification academicQualification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(academicQualification);
                await _context.SaveChangesAsync();

                return(RedirectToAction("AcademicQualification", "UserProfile", new { Messege = "New Academic Qualification is Added " }));
            }
            else
            {
                return(RedirectToAction("AcademicQualification", "UserProfile", new { Messege = "There is a problem" }));
            }
        }