public ActionResult Detail(int id, string returnUrl) { ViewBag.ReturnUrl = returnUrl; ViewBag.tags = TagHelper.GetTags(id, "NonProfitOrg"); NonProfitOrg model; if (id == 0) { model = new NonProfitOrg(); model.IdentificationNumber = EntityHelper.Create16DigitString(); } else { model = new Entities().NonProfitOrg.Single(e => e.Id == id); } if (model.Deleted) { ViewBag.CanEdit = false; } return(View(model)); }
public ActionResult Detail(int id, string returnUrl) { ViewBag.ReturnUrl = returnUrl; ViewBag.tags = TagHelper.GetTags(id, "Company"); Company model; if (id == 0) { model = new Company(); model.IdentificationNumber = EntityHelper.Create16DigitString(); model.StatusId = (int)CompanyStatusHelper.Status.LEAD; } else { model = new Entities().Company.Single(e => e.Id == id); } if (model.Deleted) { ViewBag.CanEdit = false; } return(View(model)); }