Esempio n. 1
0
 public ActionResult Create(Industry industry)
 {
     if (ModelState.IsValid) {
         industryRepository.InsertOrUpdate(industry);
         industryRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Esempio n. 2
0
 public void InsertOrUpdate(Industry industry)
 {
     if (industry.IndustryID == default(int)) {
         // New entity
         context.Industry.Add(industry);
     } else {
         // Existing entity
         context.Entry(industry).State = EntityState.Modified;
     }
 }
Esempio n. 3
0
 public ViewResult Search(Industry searchIndustry)
 {
     if(searchIndustry!=null)
     {
                     }
                 return View("Index",industryRepository.All);
 }