Exemple #1
0
 public ActionResult Create(Visa visa)
 {
     if (ModelState.IsValid) {
         visaRepository.InsertOrUpdate(visa);
         visaRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Exemple #2
0
 public void InsertOrUpdate(Visa visa)
 {
     if (visa.VisaID == default(int)) {
         // New entity
         context.Visa.Add(visa);
     } else {
         // Existing entity
         context.Entry(visa).State = EntityState.Modified;
     }
 }
Exemple #3
0
 public ViewResult Search(Visa searchVisa)
 {
     if(searchVisa!=null)
     {
                     }
                 return View("Index",visaRepository.All);
 }