Ejemplo n.º 1
0
        private static CrudEventVm GetCrudVm(Event model)
        {
            var eventVm = new CrudEventVm
            {
                Event   = model,
                Address = AddressForEventVm.GetAddress(model.Address)
            };

            return(eventVm);
        }
Ejemplo n.º 2
0
        public ActionResult GetOrganizerAddress(Guid companyId)
        {
            var company = _db.Companies.Include(i => i.Address).FirstOrDefault(f => f.CompanyId == companyId);

            if (company?.Address == null)
            {
                return(PartialView("_FormAddress"));
            }

            var cities = _db.Cities.OrderBy(o => o.Name);

            ViewBag.Cities = new SelectList(cities, "CityId", "Name", company.Address?.CityId);
            company.Address.SetCoordinates();

            return(PartialView("_Address", AddressForEventVm.GetAddress(company.Address)));
        }