Esempio n. 1
0
        /// <summary>
        /// Updates the letters.
        /// </summary>
        /// <param name="lettersModel">The letters model.</param>
        /// <returns>Response&lt;LettersViewModel&gt;.</returns>
        public Response <LettersViewModel> UpdateLetters(LettersViewModel lettersModel)
        {
            string apiUrl   = baseRoute + "UpdateLetters";
            var    response = communicationManager.Put <LettersModel, Response <LettersModel> >(lettersModel.ToModel(), apiUrl);

            return(response.ToViewModel());
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LettersView()
        {
            ILetterDataSource LetterDataSource = new MockLetterDataSource();
            LettersViewModel  viewModel        = new LettersViewModel(LetterDataSource);

            InitializeComponent();
            DataContext = viewModel;
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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));
 }