public ActionResult DeleteConfirmed(int id) { VisaInformation visainformation = db.VisaInformations.Find(id); db.VisaInformations.Remove(visainformation); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /a/Details/5 public ActionResult Details(int id = 0) { VisaInformation visainformation = db.VisaInformations.Find(id); if (visainformation == null) { return(HttpNotFound()); } return(View(visainformation)); }
public ActionResult Edit(VisaInformation visainformation) { if (ModelState.IsValid) { db.Entry(visainformation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(db.Countries, "Id", "Name", visainformation.CountryId); return(View(visainformation)); }
// // GET: /a/Edit/5 public ActionResult Edit(int id = 0) { VisaInformation visainformation = db.VisaInformations.Find(id); if (visainformation == null) { return(HttpNotFound()); } ViewBag.CountryId = new SelectList(db.Countries, "Id", "Name", visainformation.CountryId); return(View(visainformation)); }
public ActionResult AddVisaInformation(VisaInformation visainformation) { if (ModelState.IsValid) { _visaService.Add(visainformation); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(_countryService.GetAll(), "Id", "Name", visainformation.CountryId); /*return View(visainformation);*/ return(RedirectToAction("Index", "Home")); }
public ActionResult Create(VisaInformation visainformation) { if (ModelState.IsValid) { db.VisaInformations.Add(visainformation); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(db.Countries, "Id", "Name", visainformation.CountryId); return(View(visainformation)); }
public void Add(VisaInformation visaInformation) { _visaInformationRepository.Add(visaInformation); }