public ActionResult AddFirm(FirmViewModel objmodel) { if (TempData["FirmId"] != null) { objmodel = _FirmService.GetFirm(Convert.ToInt64(TempData["FirmId"])); objmodel.FirmId = Convert.ToInt64(TempData["FirmId"]); } ViewBag.Success = TempData["resultMessage"]; return(View(objmodel)); }
public ActionResult Edit(int id, int?decissionId = null, Guid?userId = null, int?seminarId = null) { var firm = _firmRepository.GetNullableById(id); if (firm == null) { Message = string.Format(Messages.NotFound, "firm", id); return(this.RedirectToAction(a => a.Index())); } // if review, get the last one, if it exists var origFirm = firm.Review ? (_firmService.GetFirm(firm.FirmCode)) : firm; var viewModel = FirmViewModel.Create(Repository, firm, origFirm); ViewBag.DecissionId = decissionId; ViewBag.UserId = userId; ViewBag.SeminarId = seminarId; return(View(viewModel)); }