コード例 #1
0
        public async Task <QueueItem> MapQueueItem(WorkQueueViewModel model, string userName)
        {
            model.QueueItemViewModel = await GetQuestionSet(_queueItemGroupId);

            var csuCallbackItem = _customMapper.Map(model.DomainViewModel.DomainInfoViewModels, model.DomainViewModel.DomainGroup.ClassMapping);
            var queueItem       = (QueueItem)_customMapper.Map(model.QueueItemViewModel.DomainInfoViewModels, model.QueueItemViewModel.DomainGroup.ClassMapping);

            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "CreatedDate", DateTime.Now);
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "CreatedBy", userName);
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "QueueID", int.Parse(model.DomainViewModel.DomainGroup.ExternalReferenceId));
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "QueueGroupID", int.Parse(model.QueueItemViewModel.DomainGroup.ExternalReferenceId));
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "CustomerName", _customMapper.GetProperty(csuCallbackItem, "NameOfcaller"));
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "WescotRef", _customMapper.GetProperty(csuCallbackItem, "WescotRef"));
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "Summary", _customMapper.GetProperty(csuCallbackItem, "ReasonForCallback"));
            queueItem = (QueueItem)_customMapper.MapProperty(queueItem, "DueDate", _customMapper.GetProperty(csuCallbackItem, "DateForCallback"));

            return(queueItem);
        }
コード例 #2
0
        public async Task <bool> PostCSU(WorkQueueViewModel model, string userName)
        {
            model.QueueItemViewModel = await GetQuestionSet(_queueItemGroupId);

            bool result = false;

            try
            {
                var csuCallbackItem = _customMapper.Map(model.DomainViewModel.DomainInfoViewModels, model.DomainViewModel.DomainGroup.ClassMapping);
                var queueItem       = _customMapper.Map(model.QueueItemViewModel.DomainInfoViewModels, model.QueueItemViewModel.DomainGroup.ClassMapping);

                queueItem = _customMapper.MapProperty(queueItem, "CreatedDate", DateTime.Now);
                queueItem = _customMapper.MapProperty(queueItem, "CreatedBy", userName);
                queueItem = _customMapper.MapProperty(queueItem, "QueueID", int.Parse(model.DomainViewModel.DomainGroup.ExternalReferenceId));
                queueItem = _customMapper.MapProperty(queueItem, "QueueGroupID", int.Parse(model.QueueItemViewModel.DomainGroup.ExternalReferenceId));
                queueItem = _customMapper.MapProperty(queueItem, "CustomerName", _customMapper.GetProperty(csuCallbackItem, "NameOfcaller"));
                queueItem = _customMapper.MapProperty(queueItem, "WescotRef", _customMapper.GetProperty(csuCallbackItem, "WescotRef"));
                queueItem = _customMapper.MapProperty(queueItem, "Summary", _customMapper.GetProperty(csuCallbackItem, "ReasonForCallback"));
                queueItem = _customMapper.MapProperty(queueItem, "DueDate", _customMapper.GetProperty(csuCallbackItem, "DateForCallback"));

                csuCallbackItem = _customMapper.MapProperty(csuCallbackItem, "ReasonForTransfer", "NULL");

                QItemHolder qItemHolder = new QItemHolder
                {
                    queueItem = (QueueItem)queueItem,
                    TModel    = csuCallbackItem
                };

                result = await _httpClientConnectionQItemHolder.PostAsync(qItemHolder);
            }
            catch (Exception ex)
            {
                var x = ex.Message;
            }

            return(result);
        }