Ejemplo n.º 1
0
        public HttpResponseMessage AddOrUpdateSystemUser(SystemUserDataInfo systemUserDataInfo)
        {
            string responseMsg = string.Empty;

            if (systemUserDataInfo.ID > 0)
            {
                if (!string.IsNullOrEmpty(systemUserDataInfo.Password))
                {
                    systemUserDataInfo.Password = EncrypManager.Encode(systemUserDataInfo.Password);
                }
                SystemUserService.UpdateSystemUser(systemUserDataInfo);
                responseMsg = "修改成功";
            }
            else
            {
                systemUserDataInfo.Password = EncrypManager.Encode(systemUserDataInfo.Password);
                SystemUserService.AddSystemUser(systemUserDataInfo);
                responseMsg = "添加成功";
            }

            return(ResultJson.BuildJsonResponse(null, Models.MessageType.Information, responseMsg));
        }