private static InformationCommand ToCommand(this InformationDto information) { return(new InformationCommand { Body = information.Body }); }
public InformationDto AddInfomation(InformationDto dto) { Information information = _modelMapper.FromInformationDto(dto); Information created = _informationRepository.Add(information); InformationDto createdInformationDto = _modelMapper.ToInformationDto(created); return(createdInformationDto); }
public static Information Create(Entities.DoctorAggregate.Doctor doctor, InformationDto dto) { return(new ( dto.Type, dto.Title, dto.Priority, doctor )); }
/// <summary> /// 获取HIS系统中科室、医师、病区、床位的基本信息 /// </summary> /// <param name="param"></param> /// <returns></returns> public async Task <List <InformationDto> > GetInformation(UserInfoDto user, InformationParam param) { var resultData = await _webServiceBasic.HIS_InterfaceListAsync("03", JsonConvert.SerializeObject(param), user.职员ID); var result = new List <InformationDto>(); var init = new InformationDto(); if (resultData.Result == "1") { result = GetResultData(init, resultData); //保存基础信息 await _dataBaseHelpService.InformationInfoSave(user, result, param); } return(result); }
public async void OnNext(InformationEvent value) { Console.WriteLine("Cyclic message:", value); InformationDto code = mapper.ToInformationDto(value.Information); string body = JsonConvert.SerializeObject(code); Message message = new Message() { Action = EndpointAction.PUBLISH_INFORMATION.GetString(), Type = "DailyInfoDto", Body = body }; Console.WriteLine($"Daily information: {message}"); await _connection.SendAsync(JsonConvert.SerializeObject(message)); }
/// <summary> /// Update a Information content. /// </summary> /// <param name="body">The data of the content to be created or updated. /// <param name="id">The id of the Information content.</param> /// <returns>InformationContentDto</returns> public InformationContentDto UpdateInformationContent(InformationDto body, string id) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling UpdateInformationContent"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling UpdateInformationContent"); } var path = "/content/mycv/information/{id}"; path = path.Replace("{format}", "json"); path = path.Replace("{" + "id" + "}", ApiClient.ParameterToString(id)); var queryParams = new Dictionary <String, String>(); var headerParams = new Dictionary <String, String>(); var formParams = new Dictionary <String, String>(); var fileParams = new Dictionary <String, FileParameter>(); String postBody = null; postBody = ApiClient.Serialize(body); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "squidex-oauth-auth" }; // make the HTTP request IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); if (((int)response.StatusCode) >= 400) { throw new ApiException((int)response.StatusCode, "Error calling UpdateInformationContent: " + response.Content, response.Content); } else if (((int)response.StatusCode) == 0) { throw new ApiException((int)response.StatusCode, "Error calling UpdateInformationContent: " + response.ErrorMessage, response.ErrorMessage); } return((InformationContentDto)ApiClient.Deserialize(response.Content, typeof(InformationContentDto), response.Headers)); }
public void ToInformationDto_MapInformationFromModelToDto() { Guid id = new Guid("0f8fad5b-d9cb-469f-a165-70867728950e"); string content = "Content test"; bool isDeleted = false; Information information = new Information() { Id = id, IsDeleted = isDeleted, Content = content }; DtoModelMapper mapper = new DtoModelMapper(); InformationDto informationDto = mapper.ToInformationDto(information); Assert.AreEqual(id, informationDto.Id, "Copied 'Id' has invalid value"); Assert.AreEqual(content, informationDto.Content, "Copied 'content' has invalid value"); Assert.AreEqual(isDeleted, informationDto.IsDeleted, "Copied 'is deleted' has invalid value"); }
public HotShotMessage(InformationDto information) { Information = information; }
public Information FromInformationDto(InformationDto dto) { return(MapObject <Information>(dto)); }