Esempio n. 1
0
        public async Task OnGetAsync(long AccountId)
        {
            Account = await _accountService.GetByIdAsync(AccountId);

            if (Account == null)
            {
                throw new KuDataNotFoundException();
            }
        }
Esempio n. 2
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 WxAccountDto();
                ViewData["Mode"] = "Add";
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(long?id)
        {
            if (id.HasValue)
            {
                //编辑
                var model = await _service.GetByIdAsync(id.Value);

                if (model == null)
                {
                    throw new VinoDataNotFoundException("无法取得数据!");
                }
                ViewData["Mode"] = "Edit";
                return(View(model));
            }
            else
            {
                //新增
                WxAccountDto dto = new WxAccountDto();
                dto.Type         = EmWxAccountType.Service;
                ViewData["Mode"] = "Add";
                return(View(dto));
            }
        }
Esempio n. 4
0
        public async Task <IActionResult> DoSync(WxAccountDto model)
        {
            await service.SyncAsync(model.Id);

            return(JsonData(true));
        }
Esempio n. 5
0
        public async Task <IActionResult> Save(WxAccountDto model)
        {
            await _service.SaveAsync(model);

            return(JsonData(true));
        }