Exemplo n.º 1
0
        /// <summary>
        /// 编辑用户信息
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task <IActionResult> UsersEdit(int Id)
        {
            User entity = await userAppService.GetUserDetail(Id);

            if (entity.DepartmentId == 0)
            {
                ViewData["DepartmentName"] = "";
            }
            else
            {
                Organization org = await orgAppService.GetOrganization(entity.DepartmentId);

                ViewData["DepartmentName"] = org.Name;
            }
            return(View(entity));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据Id获取单条记录
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task <JsonResult> GetNodeData(int Id)
        {
            try
            {
                Organization entity = await orgAppService.GetOrganization(Id);

                return(Json(new AjaxResponse()
                {
                    Result = JsonConvert.SerializeObject(entity)
                }));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                return(Json(new AjaxResponse {
                    Success = false, Result = ex.Message
                }));
            }
        }