Exemple #1
0
        public DocumentStoreInfo GetCommunicationTrailById(DocumentStoreGetReq request, string token)
        {
            DocumentStoreInfo objDocumentStoreInfo = new DocumentStoreInfo()
            {
            };

            objDocumentStoreInfo = communictaionTrailProviders.GetCommunicationTrailById(request, token).Result;
            if (objDocumentStoreInfo == null)
            {
                objDocumentStoreInfo = new DocumentStoreInfo()
                {
                    ResponseStatus = new ResponseStatus()
                    {
                        Status = "Error", ErrorMessage = "Details not found."
                    }
                };
            }
            else
            {
                var files = objDocumentStoreInfo.DocumentPath.Split(',');
                if (files != null && files.Count() > 0)
                {
                    for (int i = 0; i < files.Count(); i++)
                    {
                        files[i] = System.IO.Path.GetFileName(files[i]);
                    }

                    objDocumentStoreInfo.DocumentPath = string.Join(',', files);
                }
            }
            return(objDocumentStoreInfo);
        }
Exemple #2
0
        public async Task <DocumentStoreInfo> GetCommunicationTrailById(DocumentStoreGetReq request, string ticket)
        {
            DocumentStoreInfo documentStoreInfo = new DocumentStoreInfo();

            documentStoreInfo = await serviceProxy.PostData(_configuration.GetValue <string>("DocumentStore:GetCommunicationTrailById"), request, typeof(DocumentStoreInfo), ticket);

            return(documentStoreInfo);
        }
        /// <summary>
        /// Insert/Update mDocumentStore collection in SQL Documents and communicationslog table
        /// </summary>
        /// <param name="objDocumentStoreGetReq">Takes DocumentId ,DocumentType , QRF,Booking , Position, ARH,Supplier , Client ,SendStatus</param>
        /// <returns></returns>
        public async Task <ResponseStatus> SetDocumentsAndCommuncationsLogDetails(DocumentStoreGetReq objDocumentStoreGetReq)
        {
            ResponseStatus objResponseStatus = new ResponseStatus();

            objResponseStatus = await serviceProxy.PostData(_configuration.GetValue <string>("Bridge:Bookings:SetDocumentsAndCommuncationsLogDetails"), objDocumentStoreGetReq, typeof(ResponseStatus), "Bridge");

            return(objResponseStatus);
        }
Exemple #4
0
        public IActionResult GetCommunicationTrailById(DocumentStoreGetReq model)
        {
            DocumentStoreInfo objDocumentStoreInfo = communicationTrailMapping.GetCommunicationTrailById(model, token);

            if (objDocumentStoreInfo?.ResponseStatus?.Status.ToLower() == "success")
            {
                return(Json(new { model = objDocumentStoreInfo, maildt = objDocumentStoreInfo.SendDate.ToString("MMM dd yyy HH:mm") }));
            }
            else
            {
                return(Json(new { model = objDocumentStoreInfo, maildt = "" }));
            }
        }
Exemple #5
0
        public CommunicationTrailViewModel GetCommunicationTrail(DocumentStoreGetReq request, string token)
        {
            CommunicationTrailViewModel model = new CommunicationTrailViewModel();

            model.DocumentStoreInfoGetRes = new DocumentStoreInfoGetRes();
            try
            {
                model.DocumentStoreInfoGetRes = communictaionTrailProviders.GetCommunicationTrail(request, token)?.Result;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(model);
        }
        public async Task <DocumentStoreInfo> GetCommunicationTrailById(DocumentStoreGetReq request)
        {
            var res = new DocumentStoreInfo()
            {
                ResponseStatus = new ResponseStatus()
            };

            try
            {
                if (!string.IsNullOrEmpty(request.DocumentId))
                {
                    var mDocumentStore = await _MongoContext.mDocumentStore.Find(a => a.Document_Id == request.DocumentId).FirstOrDefaultAsync();

                    if (mDocumentStore != null)
                    {
                        res = new DocumentStoreInfo()
                        {
                            To                                                                                    = mDocumentStore.To != null?string.Join(',', mDocumentStore.To) : "",
                                                                       Body                                       = mDocumentStore.Body,
                                                                       DocumentPath                               = mDocumentStore.DocumentPath != null?string.Join(',', mDocumentStore.DocumentPath) : "",
                                                                                                         From     = mDocumentStore.From,
                                                                                                         SendDate = mDocumentStore.SendDate != null?TimeZoneInfo.ConvertTimeFromUtc(mDocumentStore.SendDate.Value, INDIAN_ZONE)  : DateTime.MinValue,
                                                                                                                        SendStatus     = mDocumentStore.SendStatus,
                                                                                                                        Subject        = mDocumentStore.Subject,
                                                                                                                        ResponseStatus = new ResponseStatus()
                        };
                        res.ResponseStatus.Status = "Success";
                    }
                    else
                    {
                        res.ResponseStatus.Status       = "Failure";
                        res.ResponseStatus.ErrorMessage = "Communication Trail details not found.";
                    }
                }
                else
                {
                    res.ResponseStatus.Status       = "Failure";
                    res.ResponseStatus.ErrorMessage = "DocumentId can not be null/blank.";
                }
            }
            catch (Exception ex)
            {
                res.ResponseStatus.Status       = "Failure";
                res.ResponseStatus.ErrorMessage = !string.IsNullOrEmpty(ex.Message) ? ex.Message : (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) ? ex.InnerException.Message : "";
            }
            return(res);
        }
Exemple #7
0
        public IActionResult LoadCommunicationTrail(string bn, string asid)
        {
            CommunicationTrailViewModel model = new CommunicationTrailViewModel();

            try
            {
                #region GetCommunicationTrail
                DocumentStoreGetReq req = new DocumentStoreGetReq();
                req.BookingNumber       = bn;
                req.AlternateService_Id = asid;
                CommunicationTrailViewModel objCommunicationTrailViewModel = communicationTrailMapping.GetCommunicationTrail(req, token);
                model = objCommunicationTrailViewModel;
                #endregion

                return(PartialView("~/Views/Shared/CommunicationTrail/_CommunicationTrail.cshtml", objCommunicationTrailViewModel));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public async Task <DocumentStoreInfoGetRes> GetCommunicationTrail([FromBody] DocumentStoreGetReq request)
        {
            var response = new DocumentStoreInfoGetRes();

            try
            {
                if (request != null)
                {
                    response = await _documentStoreRepository.GetCommunicationTrail(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }
            return(response);
        }
Exemple #9
0
        public IActionResult GetCommunicationTrail(DocumentStoreGetReq model)
        {
            CommunicationTrailViewModel objCommunicationTrailViewModel = communicationTrailMapping.GetCommunicationTrail(model, token);

            return(PartialView("~/Views/Shared/CommunicationTrail/_CommunicationTrail.cshtml", objCommunicationTrailViewModel));
        }
Exemple #10
0
        public ActionResult HotelAvailabilityRequest(string bn, string pid, string asid, string st, string avl, string om, string clr = "email", string pagename = "")
        {
            UpdateAvailabilityViewModel model = new UpdateAvailabilityViewModel();

            try
            {
                AvailabilityRequestDetailsGetReq requestAvailability = new AvailabilityRequestDetailsGetReq()
                {
                    BookingNumber = bn,
                    PositionId    = pid,
                    AltSvcId      = asid,
                    MailStatus    = st,
                    MailType      = "",
                    QRFID         = ""
                };
                AvailabilityRequestDetailsGetRes response = hotelsProviders.GetHotelAvailabilityRequestDetails(requestAvailability).Result;

                #region Set Costing Officer Tour Info Header
                model.COHeaderViewModel.QRFID         = response.CostingGetProperties.QRFID;
                model.COHeaderViewModel.AgentName     = response.CostingGetProperties.AgentInfo.AgentName;
                model.COHeaderViewModel.TourCode      = response.CostingGetProperties.AgentProductInfo.TourCode;
                model.COHeaderViewModel.TourName      = response.CostingGetProperties.AgentProductInfo.TourName;
                model.COHeaderViewModel.NoOfNights    = Convert.ToInt32(response.CostingGetProperties.AgentProductInfo.Duration);
                model.COHeaderViewModel.NoOfDays      = Convert.ToInt32(response.CostingGetProperties.AgentProductInfo.Duration) + 1;
                model.COHeaderViewModel.SalesPerson   = response.CostingGetProperties.SalesOfficer;
                model.COHeaderViewModel.ContactPerson = response.CostingGetProperties.AgentInfo.ContactPerson;
                model.COHeaderViewModel.Destination   = response.CostingGetProperties.AgentProductInfo.Destination;
                model.COHeaderViewModel.TravelDate    = response.CostingGetProperties.DepartureDates.Count > 0 ? response.CostingGetProperties.DepartureDates[0].Date : null;
                model.COHeaderViewModel.Version       = response.CostingGetProperties.VersionId;
                model.COHeaderViewModel.SystemPhone   = response.CostingGetProperties.AgentInfo.MobileNo;
                model.COHeaderViewModel.BookingNumber = bn;
                #endregion

                #region Set SRP, Request Details & etc
                model.ProductsSRPViewModel = new ProductsSRPViewModel
                {
                    PageName          = "hotel",
                    ProductSRPDetails = response.ProductSRPDetails
                };

                model.SupplierId                = response.UpdateReqDetails.SupplierId;
                model.BookingNumber             = bn;
                model.Status                    = st;
                model.OpenMode                  = om?.ToLower();
                model.Availability              = !string.IsNullOrEmpty(avl) ? avl : response.UpdateReqDetails.Availability;
                model.PositionId                = pid;
                model.AltSvcId                  = asid;
                model.BudgetCurrencyList        = response.CurrencyList;
                model.UpdateReqDetails          = response.UpdateReqDetails;
                model.ReservationRequestDetails = response.ReservationRequestDetails;
                model.RoomRateDetails           = response.AltSvcRoomsAndPrices;
                model.BudgetSupplements         = response.BudgetSupplements;

                if (response.ResponseStatus.Status == "pending" || st == "pending")
                {
                    model.Status = "pending";
                }
                else if (response.ResponseStatus.Status == "done")
                {
                    model.Status = "done";
                }

                #endregion

                ViewBag.Caller = clr;

                if (pagename == "view")
                {
                    #region GetCommunicationTrail
                    DocumentStoreGetReq req = new DocumentStoreGetReq();
                    req.BookingNumber       = bn;
                    req.AlternateService_Id = asid;
                    CommunicationTrailViewModel objCommunicationTrailViewModel = communicationTrailMapping.GetCommunicationTrail(req, token);
                    model.CommunicationTrailViewModel = objCommunicationTrailViewModel;
                    #endregion
                }



                ViewBag.Page = pagename;

                return(View(model));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
        public async Task <DocumentStoreGetRes> GetDocumentStore(DocumentStoreGetReq request)
        {
            var res = new DocumentStoreGetRes()
            {
                DocumentStoreList = new List <mDocumentStore>(), ResponseStatus = new ResponseStatus()
            };

            try
            {
                if (request != null)
                {
                    FilterDefinition <mDocumentStore> filter;
                    filter = Builders <mDocumentStore> .Filter.Empty;

                    if (!string.IsNullOrEmpty(request.DocumentId))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.Document_Id == request.DocumentId);
                    }
                    if (!string.IsNullOrEmpty(request.DocumentType))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.DocumentType.ToLower() == request.DocumentType.ToLower());
                    }
                    if (!string.IsNullOrEmpty(request.QRFID))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.QRFID == request.QRFID);
                    }
                    if (!string.IsNullOrEmpty(request.BookingNumber))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.BookingNumber == request.BookingNumber);
                    }
                    if (!string.IsNullOrEmpty(request.Position_Id))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.PositionId == request.Position_Id);
                    }
                    if (!string.IsNullOrEmpty(request.Supplier_Id))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.SupplierId == request.Supplier_Id);
                    }
                    if (!string.IsNullOrEmpty(request.Client_Id))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.ClientId == request.Client_Id);
                    }
                    if (!string.IsNullOrEmpty(request.AlternateService_Id))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.AlternateServiceId == request.AlternateService_Id);
                    }
                    if (!string.IsNullOrEmpty(request.SendStatus))
                    {
                        filter = filter & Builders <mDocumentStore> .Filter.Where(f => f.SendStatus.ToLower() == request.SendStatus.ToLower());
                    }

                    var mDocumentStoreList = await _MongoContext.mDocumentStore.Find(filter).ToListAsync();

                    if (mDocumentStoreList != null && mDocumentStoreList.Count > 0)
                    {
                        res.DocumentStoreList     = mDocumentStoreList;
                        res.ResponseStatus.Status = "Success";
                    }
                    else
                    {
                        res.ResponseStatus.Status       = "Failure";
                        res.ResponseStatus.ErrorMessage = "Records not found.";
                    }
                }
                else
                {
                    res.ResponseStatus.Status       = "Failure";
                    res.ResponseStatus.ErrorMessage = "Request can not be null/blank.";
                }
            }
            catch (Exception ex)
            {
                res.ResponseStatus.Status       = "Failure";
                res.ResponseStatus.ErrorMessage = !string.IsNullOrEmpty(ex.Message) ? ex.Message : (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) ? ex.InnerException.Message : "";
            }
            return(res);
        }
        public async Task <DocumentStoreInfoGetRes> GetCommunicationTrail(DocumentStoreGetReq request)
        {
            var res = new DocumentStoreInfoGetRes()
            {
                DocumentStoreList = new List <DocumentStoreList>(),
                DocumentStoreInfo = new DocumentStoreInfo(),
                ResponseStatus    = new ResponseStatus(),
                BookingNumber     = request.BookingNumber,
                QRFID             = request.QRFID
            };

            try
            {
                if (request != null)
                {
                    if (!string.IsNullOrEmpty(request.QRFID))
                    {
                        var QRFPrice = _MongoContext.mQRFPrice.AsQueryable().Where(x => x.QRFID == request.QRFID && x.IsCurrentVersion == true && x.IsDeleted == false).OrderByDescending(y => y.VersionId).FirstOrDefault();
                        res.AgentTourName = QRFPrice.AgentProductInfo.TourName;
                    }
                    DocumentStoreGetRes objDocumentStoreGetRes = await GetDocumentStore(request);

                    if (objDocumentStoreGetRes?.ResponseStatus?.Status.ToLower() == "success" && objDocumentStoreGetRes?.DocumentStoreList?.Count > 0)
                    {
                        res.DocumentStoreList = objDocumentStoreGetRes.DocumentStoreList.Select(a => new DocumentStoreList
                        {
                            DocumentId = a.Document_Id,
                            From       = a.From,
                            Subject    = a.Subject,
                            SendDate   = a.SendDate != null ? TimeZoneInfo.ConvertTimeFromUtc(a.SendDate.Value, INDIAN_ZONE) : DateTime.MinValue,
                            SendStatus = a.SendStatus,
                            To         = a.To != null ? string.Join(',', a.To) : ""
                        }).ToList();

                        var firstemail = objDocumentStoreGetRes.DocumentStoreList.FirstOrDefault();
                        res.DocumentStoreInfo = new DocumentStoreInfo()
                        {
                            To                                                                                    = firstemail.To != null?string.Join(',', firstemail.To) : "",
                                                                       Body                                       = firstemail.Body,
                                                                       DocumentPath                               = firstemail.DocumentPath != null?string.Join(',', firstemail.DocumentPath) : "",
                                                                                                         From     = firstemail.From,
                                                                                                         SendDate = firstemail.SendDate != null?TimeZoneInfo.ConvertTimeFromUtc(firstemail.SendDate.Value, INDIAN_ZONE) : DateTime.MinValue,
                                                                                                                        SendStatus = firstemail.SendStatus,
                                                                                                                        Subject    = firstemail.Subject
                        };
                        res.ResponseStatus.Status = "Success";
                    }
                    else
                    {
                        if (objDocumentStoreGetRes?.ResponseStatus?.Status.ToLower() != "success")
                        {
                            res.ResponseStatus.Status       = "Failure";
                            res.ResponseStatus.ErrorMessage = objDocumentStoreGetRes?.ResponseStatus?.ErrorMessage;
                        }
                        else
                        {
                            res.ResponseStatus.Status       = "Failure";
                            res.ResponseStatus.ErrorMessage = "Communication Trail details not found.";
                        }
                    }
                }
                else
                {
                    res.ResponseStatus.Status       = "Failure";
                    res.ResponseStatus.ErrorMessage = "Request can not be null/blank.";
                }
            }
            catch (Exception ex)
            {
                res.ResponseStatus.Status       = "Failure";
                res.ResponseStatus.ErrorMessage = !string.IsNullOrEmpty(ex.Message) ? ex.Message : (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message)) ? ex.InnerException.Message : "";
            }
            return(res);
        }