Example #1
0
 public MinistryViewModel ToMinistryViewModel(Ministry ministry)
 {
     return(new MinistryViewModel
     {
         // ChurchEvents = ministry.ChurchEvents,
         FollowUpHistories = ministry.FollowUpHistories,
         Id = ministry.Id,
         ImageUrl = ministry.ImageUrl,
         Name = ministry.Name,
         Admin = ministry.Admin,
         MinistryType = ministry.MinistryType,
         AdminId = ministry.Admin.Id,
         MinistryTypeId = ministry.MinistryType.Id,
         MinistryTypes = _combosHelper.GetComboMinistryTypes()
     });
 }
Example #2
0
        }      // GET: Admins/AddMinistry/5

        public async Task <IActionResult> AddMinistry(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var admin = await _context.Admins.FindAsync(id.Value);

            if (admin == null)
            {
                return(NotFound());
            }
            var model = new MinistryViewModel
            {
                AdminId       = admin.Id,
                MinistryTypes = _combosHelper.GetComboMinistryTypes()
            };

            return(View(model));
        }