Exemple #1
0
 public void InsertOrUpdate(UserRole userrole)
 {
     if (userrole.UserRoleID == default(int)) {
         // New entity
         context.UserRole.Add(userrole);
     } else {
         // Existing entity
         context.Entry(userrole).State = EntityState.Modified;
     }
 }
Exemple #2
0
 public ActionResult Create(UserRole userrole)
 {
     if (ModelState.IsValid) {
         userroleRepository.InsertOrUpdate(userrole);
         userroleRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View(userrole);
     }
 }
Exemple #3
0
 public ActionResult Create()
 {
     UserRole userrole = new UserRole();
     return View(userrole);
 }
Exemple #4
0
 public ViewResult Search(UserRole searchUserRole)
 {
     if(searchUserRole!=null)
     {
                     }
                 return View("Index",userroleRepository.All);
 }