예제 #1
0
        public IActionResult Load(long id)
        {
            var result = _providerService.GetById(id);

            UpdateViewModel model;

            if (result.HasErrors())
            {
                model = new UpdateViewModel()
                {
                    Message = result.GetFailure()
                };

                return(View(model));
            }

            model = new UpdateViewModel()
            {
                Id          = id,
                Name        = result.GetPayload().Name,
                CountryCode = result.GetPayload().Country
            };

            return(View(model));
        }
        public async Task <ActionResult> GetById(string providerId)
        {
            var apiRep  = new APIResponse();
            var product = await _providerService.GetById(providerId);

            apiRep.Error = false;
            apiRep.Data  = product;

            return(Ok(apiRep));
        }
예제 #3
0
        public ActionResult Edit(int id)

        {
            return(View(p.GetById(id)));
        }