public ActionResult Create() { var model = new OrganizationFormModel(); var organization = OrganizationRepository.OrganizationNew(); model.Title = "Organization Create"; model.Organization = organization; model.OrganizationId = -1; return this.View(model); }
public ActionResult Create(FormCollection collection) { var model = new OrganizationFormModel(); var organization = OrganizationRepository.OrganizationNew(); this.Map(collection, organization); organization = OrganizationRepository.OrganizationSave(organization); if (organization.IsValid) { return this.RedirectToAction("Index", "Home"); } model.Title = "Organization Create"; model.Organization = organization; model.OrganizationId = -1; ModelHelper.MapBrokenRules(this.ModelState, organization); return this.View(model); }
public ActionResult Edit(int id) { var model = new OrganizationFormModel(); var organization = OrganizationRepository.OrganizationFetch(id); model.Title = "Organization Edit"; model.Organization = organization; return this.View(model); }