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);
        }
Пример #2
0
        /// <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;
        }
Пример #3
0
 public static SpecialNeed SpecialNeed(int? count)
 {
     var rtValue = new SpecialNeed();
     rtValue.Name = "Name" + count.Extra();
     rtValue.IsActive = true;
     return rtValue;
 }
Пример #4
0
        /// <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;
        }