public async Task OnGetAsync(int id = 0) { if (id != 0) { Agent = (await _agent.GetModelAsync(m => m.Id == id)).data; Agent.LoginName = (await _admin.GetModelAsync(m => m.Guid == Agent.Admin_Guid)).data.LoginName; } else { Agent = new CmsAgent(); } Levels = (await _level.GetListAsync()).data; }
public Task <ApiResult <string> > UpdateStatus([FromBody] CmsAgent parm) => agentService.UpdateStatusAsync(parm);
public async Task <IActionResult> Edit([FromBody] CmsAgent parm) { return(Ok(await agentService.UpdateAsync(parm))); }
public async Task <IActionResult> Add([FromBody] CmsAgent parm) { parm.Curr_Admin_Guid = await HttpContext.LoginUserId(); return(Ok(await agentService.AddAsync(parm))); }