public ActionResult Create(SpecialNeed specialNeed) { ModelState.Clear(); MvcValidationAdapter.TransferValidationMessagesTo(ModelState, specialNeed.ValidationResults()); if (ModelState.IsValid) { Repository.OfType<SpecialNeed>().EnsurePersistent(specialNeed); Message = "Special Need Created"; return this.RedirectToAction(a => a.Index()); } Message = "Special Need Not Created"; return View(specialNeed); }
/// <summary> /// Initializes a new instance of the <see cref="PatientSpecialNeed"/> class. /// </summary> /// <param name="specialNeed">The special need.</param> public PatientSpecialNeed( SpecialNeed specialNeed ) { Check.IsNotNull ( specialNeed, "Special need is required." ); _specialNeed = specialNeed; }
public static SpecialNeed SpecialNeed(int? count) { var rtValue = new SpecialNeed(); rtValue.Name = "Name" + count.Extra(); rtValue.IsActive = true; return rtValue; }
/// <summary> /// Initializes a new instance of the <see cref="PatientSpecialNeed"/> class. /// </summary> /// <param name="specialNeed">The special need.</param> public PatientSpecialNeed(SpecialNeed specialNeed) { Check.IsNotNull(specialNeed, "Special need is required."); _specialNeed = specialNeed; }