public async Task <OpsBookingItinerarySetRes> SetItineraryBuilderDetails([FromBody] OpsBookingItinerarySetReq request)
        {
            var response = new OpsBookingItinerarySetRes();

            try
            {
                if (request != null)
                {
                    var result = await _opsRepository.SetItineraryBuilderDetails(request);

                    if (result != null)
                    {
                        response = result;
                        response.ResponseStatus.Status = "Success";
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Failure";
                        response.ResponseStatus.ErrorMessage = "Ann Error Occurs.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Booking details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
        public async Task <OpsBookingItinerarySetRes> SetItineraryBuilderDetails(OpsBookingItinerarySetReq opsBookingItinerarySetReq, string ticket)
        {
            OpsBookingItinerarySetRes objOpsBookingItinerarySetRes = new OpsBookingItinerarySetRes();

            objOpsBookingItinerarySetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceOperations:SetItineraryBuilderDetails"), opsBookingItinerarySetReq, typeof(OpsBookingItinerarySetRes), ticket);

            return(objOpsBookingItinerarySetRes);
        }
Exemple #3
0
        public IActionResult SaveRemarksForPosition(string QRFID, string PositionId, string ItineraryId, string ItineraryDaysId, string TLRemarks, string OPSRemarks, string BookingNumber)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(BookingNumber))
                {
                    OpsBookingItinerarySetReq req = new OpsBookingItinerarySetReq()
                    {
                        BookingNumber    = BookingNumber,
                        ItineraryDetails = new ItineraryDetails()
                        {
                            TLRemarks          = TLRemarks,
                            OPSRemarks         = OPSRemarks,
                            ItineraryDetail_Id = ItineraryId
                        }
                    };
                    OpsBookingItinerarySetRes res = operationsProviders.SetRemarksForItineraryBuilderDetails(req, token).Result;
                    if (res.ResponseStatus.Status.ToLower() == "success")
                    {
                        return(Json(new { responseText = "Success! Remarks updated successfully." }));
                    }
                    else
                    {
                        return(Content("Error"));
                    }
                }
                else
                {
                    ItinerarySetRes response = new ItinerarySetRes();
                    ItinerarySetReq request  = new ItinerarySetReq();

                    request.QRFId           = QRFID;
                    request.ItineraryId     = ItineraryId;
                    request.ItineraryDaysId = ItineraryDaysId;
                    request.PositionId      = PositionId;
                    request.TLRemarks       = TLRemarks;
                    request.OPSRemarks      = OPSRemarks;
                    response = coProviders.SaveRemarks(request, token).Result;

                    if (response.ResponseStatus.Status.ToLower() == "success")
                    {
                        return(Json(new { responseText = "Success! Remarks updated successfully." }));
                    }
                    else
                    {
                        return(Content("Error"));
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #4
0
        public IActionResult SaveNewItineraryElement(ExtraPosition position)
        {
            //if (ModelState.IsValid)
            //{
            ItinerarySetRes           response = new ItinerarySetRes();
            ItinerarySetReq           request  = new ItinerarySetReq();
            OpsBookingItinerarySetReq req      = new OpsBookingItinerarySetReq();
            OpsBookingItinerarySetRes res      = new OpsBookingItinerarySetRes();


            if (position.flag == true)
            {
                string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName;

                if (string.IsNullOrEmpty(position.PositionId))
                {
                    request.IsExtraItineraryElement = true;
                }
                else
                {
                    request.IsExtraItineraryElement = false;
                }

                if (string.IsNullOrWhiteSpace(position.ProductName))
                {
                    return(Json(new { responseText = "Please Enter Description", status = "error" }));
                }

                request.itinerary.QRFID       = position.QRFID;
                request.itinerary.ItineraryID = position.ItineraryID;
                request.itinerary.ItineraryDays.Add(new ItineraryDaysInfo
                {
                    ItineraryDaysId = position.ItineraryDaysId
                });

                request.itinerary.ItineraryDays[0].ItineraryDescription.Add(new ItineraryDescriptionInfo
                {
                    ProductType = "",
                    ProductName = position.ProductName,
                    PositionId  = position.PositionId
                });
                request.itinerary.EditUser   = UserName;
                request.itinerary.CreateUser = UserName;
                response = coProviders.SetItinerary(request, token).Result;


                if (response.ResponseStatus.Status.ToLower() == "success")
                {
                    return(Json(new { responseText = "Record Saved Successfully" }));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            else
            {
                if (string.IsNullOrWhiteSpace(position.ItineraryDaysId))
                {
                    string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName;
                    req.BookingNumber    = position.QRFID;
                    req.Type             = "NewElement";
                    req.ItineraryDetails = new ItineraryDetails()
                    {
                        ItineraryDetail_Id = position.ItineraryID,
                        ProductType        = "",
                        CityName           = position.City,
                        STARTTIME          = position.StartTime,
                        ENDTIME            = position.EndTime,
                        Description        = position.ProductName,
                        DayNo = Convert.ToInt32(position.Day.Split(" ")[1])
                    };
                    res = operationsProviders.SetRemarksForItineraryBuilderDetails(req, token).Result;

                    if (res.ResponseStatus.Status.ToLower() == "success")
                    {
                        return(Json(new { responseText = "Record Saved Successfully", ItineraryDetailId = res.ItineraryDetailId }));
                    }
                    else
                    {
                        return(Content("Error"));
                    }
                }
                else
                {
                    string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName;

                    if (string.IsNullOrEmpty(position.PositionId))
                    {
                        request.IsExtraItineraryElement = true;
                    }
                    else
                    {
                        request.IsExtraItineraryElement = false;
                    }

                    request.itinerary.QRFID       = position.QRFID;
                    request.itinerary.ItineraryID = position.ItineraryID;
                    request.itinerary.ItineraryDays.Add(new ItineraryDaysInfo
                    {
                        ItineraryDaysId = position.ItineraryDaysId
                    });

                    request.itinerary.ItineraryDays[0].ItineraryDescription.Add(new ItineraryDescriptionInfo
                    {
                        ProductType = "",
                        City        = position.City,
                        StartTime   = position.StartTime,
                        EndTime     = position.EndTime,
                        Type        = "Extra",
                        ProductName = position.ProductName,
                        PositionId  = position.PositionId
                    });
                    request.itinerary.EditUser   = UserName;
                    request.itinerary.CreateUser = UserName;
                    response = coProviders.SetItinerary(request, token).Result;


                    if (response.ResponseStatus.Status.ToLower() == "success")
                    {
                        return(Json(new { responseText = "Record Saved Successfully" }));
                    }
                    else
                    {
                        return(Content("Error"));
                    }
                }
            }
            //}
        }