Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            VisaInformation visainformation = db.VisaInformations.Find(id);

            db.VisaInformations.Remove(visainformation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        //
        // GET: /a/Details/5

        public ActionResult Details(int id = 0)
        {
            VisaInformation visainformation = db.VisaInformations.Find(id);

            if (visainformation == null)
            {
                return(HttpNotFound());
            }
            return(View(visainformation));
        }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
        //
        // 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));
        }
Esempio n. 5
0
        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"));
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
 public void Add(VisaInformation visaInformation)
 {
     _visaInformationRepository.Add(visaInformation);
 }