Beispiel #1
0
        public SwntPerTransactionDTO Parse(SwntPerTransaction model)
        {
            var pipeline = pipelineRepository.GetPipelineByDuns(model.TransportationserviceProvider);

            return(new SwntPerTransactionDTO()
            {
                Id = model.Id,
                TransactionId = model.TransactionId,
                ReceiveFileId = model.ReceiveFileId,
                PipelineId = pipeline.ID,
                PipelineNameDuns = pipeline.Name + " (" + pipeline.DUNSNo + ")",
                TransactionIdentifierCode = model.TransactionIdentifierCode,
                TransactionControlNumber = model.TransactionControlNumber,
                TransactionSetPurposeCode = model.TransactionSetPurposeCode,
                Description = model.Description,
                NoticeEffectiveDateTime = model.NoticeEffectiveDateTime,
                NoticeEndDateTime = model.NoticeEndDateTime,
                PostingDateTime = model.PostingDateTime,
                ResponseDateTime = model.ResponseDateTime,
                TransportationserviceProvider = model.TransportationserviceProvider,
                TransportationServiceProviderPropCode = model.TransportationServiceProviderPropCode,
                CriticalNoticeIndicator = model.CriticalNoticeIndicator,
                FreeFormMessageText = model.FreeFormMessageText,
                CreatedDate = model.CreatedDate,
                IsActive = model.IsActive,
                Message = model.Message,
                NoticeId = model.NoticeId,
                NoticeTypeDesc1 = model.NoticeTypeDesc1,
                NoticeTypeDesc2 = model.NoticeTypeDesc2,
                ReqrdResp = model.ReqrdResp,
                Subject = GetSubjectUsingNoticeDetails(model.Subject, model.Message),
                PriorNotice = model.PriorNotice,
                NoticeStatusDesc = model.NoticeStatusDesc,
            });
        }
Beispiel #2
0
        public BONotice GetNoticeById(int id)
        {
            SwntPerTransaction swnt = dbcontext.SwntPerTransactions.Where(a => a.Id == id).FirstOrDefault();
            var notice = MappingNotice(swnt);

            return(notice);
        }
Beispiel #3
0
        private SwntPerTransaction Create(SwntPerTransactionDTO a)
        {
            SwntPerTransaction swnt = new SwntPerTransaction();

            swnt.CreatedDate             = a.CreatedDate;
            swnt.CriticalNoticeIndicator = a.CriticalNoticeIndicator;
            swnt.Description             = a.Description;
            swnt.FreeFormMessageText     = a.FreeFormMessageText;
            swnt.Id       = a.Id;
            swnt.IsActive = a.IsActive;
            swnt.Message  = a.Message;
            swnt.NoticeEffectiveDateTime = a.NoticeEffectiveDateTime;
            swnt.NoticeEndDateTime       = a.NoticeEndDateTime;
            swnt.NoticeId                              = a.NoticeId;
            swnt.NoticeStatusDesc                      = a.NoticeStatusDesc;
            swnt.NoticeTypeDesc1                       = a.NoticeTypeDesc1;
            swnt.NoticeTypeDesc2                       = a.NoticeTypeDesc2;
            swnt.PipelineId                            = a.PipelineId;
            swnt.PostingDateTime                       = a.PostingDateTime;
            swnt.PriorNotice                           = a.PriorNotice;
            swnt.ReceiveFileId                         = a.ReceiveFileId;
            swnt.ReqrdResp                             = a.ReqrdResp;
            swnt.ResponseDateTime                      = a.ResponseDateTime == DateTime.MinValue ? null : a.ResponseDateTime;
            swnt.Subject                               = a.Subject;
            swnt.TransactionControlNumber              = a.TransactionControlNumber;
            swnt.TransactionId                         = a.TransactionId;
            swnt.TransactionIdentifierCode             = a.TransactionIdentifierCode;
            swnt.TransactionSetPurposeCode             = a.TransactionSetPurposeCode;
            swnt.TransportationserviceProvider         = a.TransportationserviceProvider;
            swnt.TransportationServiceProviderPropCode = a.TransportationServiceProviderPropCode;
            return(swnt);
        }
Beispiel #4
0
        public void ProcessSWNTFiles(List <EdiSegment> ediFile)
        {
            SwntPerTransaction model = new SwntPerTransaction();

            foreach (var item in ediFile)
            {
                // model.TransactionIdentifierCode = item.Elements item.Elements[0].ToString();
                model.TransactionControlNumber = item.Elements[1].ToString();
                //model.PipelineId=item.Elements[]
            }
        }
Beispiel #5
0
        private BONotice MapNoticeDetailDTO(SwntPerTransaction swnt)
        {
            BONotice notice = new BONotice();

            if (swnt != null)
            {
                notice.ID          = (int)swnt.Id;
                notice.Message     = swnt.Message;
                notice.subject     = GetSubjectUsingNoticeDetails(swnt.Subject, swnt.Message);
                notice.IsCritical  = swnt.CriticalNoticeIndicator.Trim() == "Y" ? true : false;
                notice.CreatedDate = swnt.PostingDateTime.GetValueOrDefault();
                if ((swnt.NoticeEffectiveDateTime) == null)
                {
                    notice.NoticeEffectiveDate = String.Empty;
                }
                else
                {
                    notice.NoticeEffectiveDate = swnt.NoticeEffectiveDateTime.GetValueOrDefault().ToString("MM/dd/yyyy");
                    //notice.NoticeEffectiveDate = Convert.ToDateTime(swnt.NoticeEffectiveDate.Substring(4, 2) + "/" + swnt.NoticeEffectiveDate.Substring(6, 2) + "/" + swnt.NoticeEffectiveDate.Substring(0, 4)).Date.ToString();
                }

                if (swnt.PostingDateTime == null)
                {
                    notice.PostingDate = String.Empty;
                }
                else
                {
                    notice.PostingDate = swnt.PostingDateTime.GetValueOrDefault().ToString("MM/dd/yyyy");
                    // notice.NoticeEndDate = Convert.ToDateTime(swnt.PostingDate.Substring(4, 2) + "/" + swnt.PostingDate.Substring(6, 2) + "/" + swnt.PostingDate.Substring(0, 4)).Date.ToString();
                }
                notice.NoticeEndDate = swnt.NoticeEndDateTime.GetValueOrDefault().ToString("MM/dd/yyyy");
                //notice.PipelineID = swnt.PipelineId;
                notice.PipelineDuns = swnt.TransportationserviceProvider;
                notice.TSP          = swnt.TransportationServiceProviderPropCode + " / " + swnt.TransportationserviceProvider;

                notice.NoticeId = swnt.NoticeId;
                notice.NoticeStatusDescription = swnt.NoticeStatusDesc;
                notice.NoticeTypeDesc1         = swnt.NoticeTypeDesc1;
                notice.NoticeTypeDesc2         = swnt.NoticeTypeDesc2;
                notice.PriorNotice             = swnt.PriorNotice;
                notice.ReqrdResp = swnt.ReqrdResp;
            }
            return(notice);
        }
Beispiel #6
0
        public SwntPerTransactionDTO Parse(SwntPerTransaction model)
        {
            return(null);
            //var pipeline = pipelineRepository.GetById(model.PipelineId);

            //return new SwntPerTransactionDTO() {
            //    Id = model.Id,
            //    TransactionId = model.TransactionId,
            //    ReceiveFileId = model.ReceiveFileId,
            //    PipelineId = model.PipelineId,
            //    PipelineNameDuns = pipeline.Name + " (" + pipeline.DUNSNo + ")",
            //    TransactionIdentifierCode = model.TransactionIdentifierCode,
            //    TransactionControlNumber = model.TransactionControlNumber,
            //    TransactionSetPurposeCode = model.TransactionSetPurposeCode,
            //    Description = model.Description,
            //    NoticeEffectiveDateTime = model.NoticeEffectiveDateTime,
            //    NoticeEndDateTime = model.NoticeEndDateTime,
            //    PostingDateTime = model.PostingDateTime,
            //    ResponseDateTime = model.ResponseDateTime,
            //    TransportationserviceProvider = model.TransportationserviceProvider,
            //    TransportationServiceProviderPropCode = model.TransportationServiceProviderPropCode,
            //    CriticalNoticeIndicator = model.CriticalNoticeIndicator,
            //    FreeFormMessageText = model.FreeFormMessageText,
            //    CreatedDate = model.CreatedDate,
            //    IsActive = model.IsActive,
            //    Message = model.Message,
            //    NoticeId = model.NoticeId,
            //    NoticeTypeDesc1 = model.NoticeTypeDesc1,
            //    NoticeTypeDesc2 = model.NoticeTypeDesc2,
            //    ReqrdResp = model.ReqrdResp,
            //    Subject = GetSubjectUsingNoticeDetails(model.Subject, model.Message),
            //    PriorNotice = model.PriorNotice,
            //    NoticeStatusDesc = model.NoticeStatusDesc,

            //};
        }
Beispiel #7
0
 public void UpdateNotice(SwntPerTransaction notice)
 {
     noticesRepository.Update(notice);
     noticesRepository.SaveChages();
 }
Beispiel #8
0
 public void AddNotice(SwntPerTransaction notice)
 {
     noticesRepository.Add(notice);
     noticesRepository.SaveChages();
 }