Пример #1
0
 public ActionResult Create(ContactFolder contactfolder)
 {
     if (ModelState.IsValid) {
         contactfolderRepository.InsertOrUpdate(contactfolder);
         contactfolderRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleCreatedByUsers = userRepository.All;
         return View(contactfolder);
     }
 }
Пример #2
0
 public void InsertOrUpdate(ContactFolder contactfolder)
 {
     if (contactfolder.ContactFolderID == default(int)) {
         // New entity
         context.ContactFolder.Add(contactfolder);
     } else {
         // Existing entity
         context.Entry(contactfolder).State = EntityState.Modified;
     }
 }
Пример #3
0
 public ActionResult Create()
 {
     ContactFolder contactfolder = new ContactFolder();
     ViewBag.PossibleCreatedByUsers = userRepository.All;
     return View(contactfolder);
 }
Пример #4
0
 public ViewResult Search(ContactFolder searchContactFolder)
 {
     if(searchContactFolder!=null)
     {
                     }
                 return View("Index",contactfolderRepository.AllIncluding(contactfolder => contactfolder.CreatedByUser));
 }