示例#1
0
        public async Task <IActionResult> Detail(long id)
        {
            //编辑
            var model = await _service.GetByIdAsync(id);

            if (model == null)
            {
                throw new VinoDataNotFoundException("无法取得数据!");
            }
            return(View(model));
        }
示例#2
0
        public async Task OnGetAsync(long id)
        {
            Dto = await _service.GetByIdAsync(id);

            if (Dto == null)
            {
                throw new KuDataNotFoundException();
            }
        }
示例#3
0
        public async Task OnGetAsync(long?id)
        {
            if (id.HasValue)
            {
                Dto = await _service.GetByIdAsync(id.Value);

                if (Dto == null)
                {
                    throw new KuDataNotFoundException();
                }
                ViewData["Mode"] = "Edit";
            }
            else
            {
                Dto = new DeliveryTempletDto();
                ViewData["Mode"] = "Add";
            }
        }