public ActionResult Create() { RequisitionTeam requisitionteam = new RequisitionTeam(); ViewBag.PossibleRequisitions = requisitionRepository.All; ViewBag.PossibleRequisitionTeamCategories = requisitionteamcategoryRepository.All; ViewBag.PossibleRequisitionTeamUsers = userRepository.All; return View(requisitionteam); }
public ActionResult Create(RequisitionTeam requisitionteam) { if (ModelState.IsValid) { requisitionteamRepository.InsertOrUpdate(requisitionteam); requisitionteamRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleRequisitions = requisitionRepository.All; ViewBag.PossibleRequisitionTeamCategories = requisitionteamcategoryRepository.All; ViewBag.PossibleRequisitionTeamUsers = userRepository.All; return View(requisitionteam); } }
public ViewResult Search(RequisitionTeam searchRequisitionTeam) { if(searchRequisitionTeam!=null) { } return View("Index",requisitionteamRepository.AllIncluding(requisitionteam => requisitionteam.Requisition, requisitionteam => requisitionteam.RequisitionTeamCategory, requisitionteam => requisitionteam.RequisitionTeamUser)); }
public void InsertOrUpdate(RequisitionTeam requisitionteam) { if (requisitionteam.RequisitionTeamID == default(int)) { // New entity context.RequisitionTeam.Add(requisitionteam); } else { // Existing entity context.Entry(requisitionteam).State = EntityState.Modified; } }