Пример #1
0
        public virtual ActionResult Edit(MinistryModel model)
        {
            if (ModelState.IsValid)
            {
                Status status;
                if (model.Update(out status))
                    ModelState.AddModelError("Error", "Successfully updated ministry");
                else
                    ModelState.AddModelError("Error", status.Message());
            }
            else
            {
                ModelState.AddModelError("Error", "Please update the required fields");
            }

            return View(model);
        }
        public static MinistryModel GetMinistryModel(this Ministry ministry)
        {
            var model = new MinistryModel
            {
                Id = ministry.Id,
                IdKey = ministry.IdKey,
                Name = ministry.Name,
                Description = ministry.Description
            };

            return model;
        }
Пример #3
0
 //[HttpPost]
 public virtual ActionResult DisplayMinistry(string ministryName)
 {
     var model = new MinistryModel();
     return View(model);
 }
        /// <summary>
        /// Creates a entity model used by the MinistriesController.Add method
        /// </summary>
        /// <returns></returns>
        public static MinistryModel GetMinistryModelForAdd()
        {
            var model = new MinistryModel();
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels System Ministry";
            model.SubTitle = "Add New Ministry";
            model.UserIdKey = userIdKey;

            model.MetaDescription = "";
            model.MetaKeywords = "";
            model.MetaSubject = "";

            return model;
        }