/// <summary> /// Updates the letters. /// </summary> /// <param name="lettersModel">The letters model.</param> /// <returns>Response<LettersViewModel>.</returns> public Response <LettersViewModel> UpdateLetters(LettersViewModel lettersModel) { string apiUrl = baseRoute + "UpdateLetters"; var response = communicationManager.Put <LettersModel, Response <LettersModel> >(lettersModel.ToModel(), apiUrl); return(response.ToViewModel()); }
/// <summary> /// Constructor /// </summary> public LettersView() { ILetterDataSource LetterDataSource = new MockLetterDataSource(); LettersViewModel viewModel = new LettersViewModel(LetterDataSource); InitializeComponent(); DataContext = viewModel; }
public static LettersModel ToModel(this LettersViewModel model) { if (model == null) { return(null); } var entity = new LettersModel { ContactLettersID = model.ContactLettersID, ContactID = model.ContactID, AssessmentID = model.AssessmentID, ResponseID = model.ResponseID, SentDate = model.SentDate, UserID = model.UserID, ProviderName = model.ProviderName, LetterOutcomeID = model.LetterOutcomeID, Comments = model.Comments, ModifiedOn = model.ModifiedOn }; return(entity); }
public static LettersViewModel ToViewModel(this LettersModel entity) { if (entity == null) { return(null); } var model = new LettersViewModel { ContactLettersID = entity.ContactLettersID, ContactID = entity.ContactID, AssessmentID = entity.AssessmentID, ResponseID = entity.ResponseID, SentDate = entity.SentDate, UserID = entity.UserID, ProviderName = entity.ProviderName, LetterOutcomeID = entity.LetterOutcomeID, Comments = entity.Comments, ModifiedOn = entity.ModifiedOn }; return(model); }
public Response <LettersViewModel> UpdateLetters(LettersViewModel lettersModel) { return(_lettersRepository.UpdateLetters(lettersModel)); }
public Response <LettersViewModel> AddLetters(LettersViewModel lettersModel) { return(_lettersRepository.AddLetters(lettersModel)); }