public ActionResult EditOrganisation(int organisationId) { if (!_organisationService.OrganisationIdExists(organisationId)) return RedirectToAction("Dashboard"); var model = new EditOrganisationDetails(); var org = _organisationService.GetOrganisation(organisationId); model.Id = org.Id; model.Name = org.Name; model.Code = org.Code; return View(model); }
public ActionResult EditOrganisation(EditOrganisationDetails model) { if (!ModelState.IsValid || !_organisationService.OrganisationIdExists(model.Id)) return View(model); _organisationService.UpdateOrganisation(new OrganisationBO {Id = model.Id,Code = model.Code ?? 0, Name = model.Name}); return RedirectToAction("Dashboard"); }