示例#1
0
        public IActionResult Edit(EditHubDetailsViewModel model)
        {
            // var user = _hubRepo.GetOwnerByEmail(User.Identity.Name);

            if (ModelState.IsValid)
            {
                Hubb hub = _hubsService.GetHub(model.ID);
                hub.HubName = model.HubName;

                hub.Keywords       = model.Keywords;
                hub.Address        = model.Address;
                hub.City           = model.City;
                hub.State          = model.State;
                hub.ZipCode        = model.ZipCode;
                hub.HubDescription = model.HubDescription;
                hub.PhoneNumber    = model.PhoneNumber;
                hub.Website        = model.Website;
                hub.Email          = model.Email;
                hub.FacebookLink   = model.FacebookLink;
                hub.TwitterLink    = model.TwitterLink;
                hub.Status         = HubStatus.Claimed;
                //hub.OwnerId = user.OwnerId;

                _hubDataStore.Update(hub);

                return(RedirectToAction("listings", "dash"));
            }
            return(View());
        }
示例#2
0
        public IActionResult Edit(Guid id)
        {
            var user = _ownerService.GetOwnerByEmail(User.Identity.Name);

            var hub = _hubsService.GetHub(id);

            ViewBag.id = id;
            EditHubDetailsViewModel editHubDetailsViewModel = new EditHubDetailsViewModel()
            {
                ID             = hub.HubbId,
                HubName        = hub.HubName,
                Keywords       = hub.Keywords,
                Address        = hub.Address,
                City           = hub.City,
                State          = hub.State,
                ZipCode        = hub.ZipCode,
                HubDescription = hub.HubDescription,
                PhoneNumber    = hub.PhoneNumber,
                Website        = hub.Website,
                Email          = hub.Email,
                FacebookLink   = hub.FacebookLink,
                TwitterLink    = hub.TwitterLink,
                Status         = HubStatus.Claimed,
                OwnerId        = user.OwnerId
            };

            return(View(editHubDetailsViewModel));
        }
示例#3
0
        public IActionResult Hubinfo(Guid id)
        {
            var hub = _hubDataStore.GetById(id);
            EditHubDetailsViewModel editHubDetailsViewModel = new EditHubDetailsViewModel()
            {
                ID       = hub.HubbId,
                HubName  = hub.HubName,
                Status   = hub.Status,
                Passcode = hub.Passcode,
                Email    = hub.Email
            };

            return(View(editHubDetailsViewModel));
        }
示例#4
0
        public IActionResult Hubinfo(EditHubDetailsViewModel model)
        {
            if (ModelState.IsValid)
            {
                Hubb hub = _hubsService.GetHub(model.ID);
                hub.HubName  = model.HubName;
                hub.Status   = model.Status;
                hub.Passcode = model.Passcode;
                hub.Email    = model.Email;

                _hubDataStore.Update(hub);

                return(RedirectToAction("AllHubs"));
            }
            return(View(model));
        }