Beispiel #1
0
        public IActionResult Edit(int id)
        {
            PhoneServiceModel phone = this.phonesService.GetById(id);

            if (phone.PhoneNumber == null)
            {
                return(this.BadRequest());
            }

            var model = new PhoneInputModel
            {
                Id          = phone.Id,
                PhoneNumber = phone.PhoneNumber,
            };

            return(this.View(model));
        }
Beispiel #2
0
        public IActionResult Details(int id)
        {
            PhoneServiceModel phone = this.phonesService.GetById(id);

            if (phone.PhoneNumber == null)
            {
                return(this.BadRequest());
            }

            var model = new PhoneDetailsViewModel
            {
                Id          = phone.Id,
                PhoneNumber = phone.PhoneNumber,
                IsInternal  = phone.IsInternal,
                // TODO: Add departments table
            };

            return(this.View(model));
        }