Exemplo n.º 1
0
        public PositionGetRoomTypeAndSuppRes GetRoomTypeAndSupplementList(List <string> HotelId, string QRFID, string token)
        {
            MasterProviders         objMasterProviders      = new MasterProviders(_configuration);
            ProdCategoryRangeGetReq prodCategoryRangeGetReq = new ProdCategoryRangeGetReq();

            prodCategoryRangeGetReq.ProductId    = HotelId;
            prodCategoryRangeGetReq.QRFID        = QRFID;
            prodCategoryRangeGetReq.AdditionalYn = false;
            PositionGetRoomTypeAndSuppRes objAcc = objPositionProviders.GetRoomTypeAndSupplement(prodCategoryRangeGetReq, token).Result;

            //List<AutoCompleteTextBox> RoomTypeList = new List<AutoCompleteTextBox>();
            //List<AutoCompleteTextBox> SupplementList = new List<AutoCompleteTextBox>();
            ////if (objAcc.ResponseStatus.Status == "Success")
            //{
            //    if (objAcc.RoomTypeList.Count > 0)
            //    {
            //        RoomTypeList = objAcc.RoomTypeList.Select(data => new AutoCompleteTextBox { value = data.ProductCategoryId + '|' + data.VoyagerProductRange_Id, label = "(" + data.ProductCategoryName + ") " + data.ProductRangeCode }).ToList();
            //    }
            //    if (objAcc.SupplementList.Count > 0)
            //    {
            //        SupplementList = objAcc.RoomTypeList.Select(data => new AutoCompleteTextBox { value = data.ProductCategoryId + '|' + data.VoyagerProductRange_Id, label = "(" + data.ProductCategoryName + ") " + data.ProductRangeCode }).ToList();
            //    }
            //    return objAcc;
            //}
            //else
            return(objAcc);
        }
Exemplo n.º 2
0
        public JsonResult GetRoomType(string HotelId, string QRFID)
        {
            PositionGetRoomTypeAndSuppRes roomTypeList = new PositionGetRoomTypeAndSuppRes();
            List<string> HotelIds = new List<string>();
            HotelIds.Add(HotelId);
            roomTypeList = posLibrary.GetRoomTypeAndSupplementList(HotelIds, QRFID, token);
            var roomsuppliments = new List<ProdCategoryRangeDetails>();
            var roomservices = new List<ProdCategoryRangeDetails>();

            roomservices = roomTypeList.DefaultRoomslist.
                OrderBy(a => a.ProductRangeCode.Contains("SINGLE") ? "A" : a.ProductRangeCode.Contains("DOUBLE") ? "B" : a.ProductRangeCode.Contains("TWIN") ? "C" : a.ProductRangeCode.Contains("TRIPLE") ? "D" :
                                   a.ProductRangeCode.Contains("QUAD") ? "E" : a.ProductRangeCode.Contains("TSU") ? "F" :
                                   a.ProductRangeCode.ToLower().Contains("child + bed") ? "G" : a.ProductRangeCode.ToLower().Contains("child - bed") ? "H" :
                                   a.ProductRangeCode.ToLower().Contains("infant") ? "I" : "J").ThenBy(a => a.ProductRangeCode).ToList();

            roomTypeList.DefaultRoomslist = roomservices;

            var roomsuppliment = new List<ProductRangeDetails>();
            var roomservice = new List<ProductRangeDetails>();

            roomservice = roomTypeList.RoomTypeList.Where(a => a.AdditionalYN == false).ToList().
                 OrderBy(a => a.ProductRangeCode.Contains("SINGLE") ? "A" : a.ProductRangeCode.Contains("DOUBLE") ? "B" : a.ProductRangeCode.Contains("TWIN") ? "C" : a.ProductRangeCode.Contains("TRIPLE") ? "D" :
                                    a.ProductRangeCode.Contains("QUAD") ? "E" : a.ProductRangeCode.Contains("TSU") ? "F" :
                                    a.PersonType.ToLower().Contains("child + bed") ? "G" : a.PersonType.ToLower().Contains("child - bed") ? "H" :
                                    a.ProductRangeCode.ToLower().Contains("infant") ? "I" : "J").ThenBy(a => a.ProductRangeCode).ToList();

            roomsuppliment = roomTypeList.RoomTypeList.Where(a => a.AdditionalYN == true).OrderBy(a => a.ProductRangeCode).ToList();
            roomservice.AddRange(roomsuppliment);
            roomTypeList.RoomTypeList = roomservice;

            return Json(roomTypeList);
        }
Exemplo n.º 3
0
        public async Task <PositionGetRoomTypeAndSuppRes> GetRoomTypeAndSupplement(ProdCategoryRangeGetReq prodCategoryRangeGetReq, string ticket)
        {
            PositionGetRoomTypeAndSuppRes positionGetRoomTypeAndSuppRes = new PositionGetRoomTypeAndSuppRes();

            positionGetRoomTypeAndSuppRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServicePosition:GetPositionRoomAndSupplement"), prodCategoryRangeGetReq, typeof(PositionGetRoomTypeAndSuppRes), ticket);

            return(positionGetRoomTypeAndSuppRes);
        }
Exemplo n.º 4
0
        public PositionGetRoomTypeAndSuppRes GetPositionRoomAndSupplement([FromBody] ProdCategoryRangeGetReq request)
        {
            var response = new PositionGetRoomTypeAndSuppRes();

            try
            {
                if (request != null && request.ProductId.Count > 0)
                {
                    var resultRoom = _productRepository.GetProductCategoryRangeByProductID(request);
                    if (resultRoom != null && resultRoom.Count > 0)
                    {
                        response.ResponseStatus.Status = "Success";
                        response.RoomTypeList          = resultRoom.ToList();

                        var resultDefaultRoom = _productRepository.GetDefaultRoomsFromQuote(request);
                        if (resultDefaultRoom != null && resultDefaultRoom.Count > 0)
                        {
                            response.ResponseStatus.Status = "Success";
                            response.DefaultRoomslist      = resultDefaultRoom.ToList();
                        }
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Success";
                        response.ResponseStatus.ErrorMessage = "No Records Found.";
                    }

                    ProductSupplierGetReq objProductSupplierGetReq = new ProductSupplierGetReq();
                    objProductSupplierGetReq.ProductId = request.ProductId[0];
                    ProductSupplierGetRes objProductSupplierGetRes = _productRepository.GetSupplierDetails(objProductSupplierGetReq);
                    if (objProductSupplierGetRes != null)
                    {
                        response.SupplierId   = objProductSupplierGetRes.SupplierId;
                        response.SupplierName = objProductSupplierGetRes.SupplierName;
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Product Id can not be null/blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }