Пример #1
0
        public ActionResult GetSightSeeingView(SightSeeingViewModel sViewModel)
        {
            int SightSeeingId = sViewModel.Filter.SightSeeingId;



            AccessoriesRepo _aRepo = new AccessoriesRepo();

            sViewModel.Images = _aRepo.GetImagesByRefType(SightSeeingId, (int)Attachment.SightSeeing);

            sViewModel.SightSeeing = _sRepo.GetSightSeeingById(sViewModel.Filter.SightSeeingId);

            return(View("SightSeeingView", sViewModel));
        }
Пример #2
0
        public ActionResult GetHotelView(HotelViewModel hViewModel)
        {
            AccessoriesRepo _aRepo = new AccessoriesRepo();

            int HotelId = hViewModel.HotelFilter.HotelId;

            hViewModel.Hotel = _hRepo.GetHotelById(HotelId);

            hViewModel.HotelFacilityDetails = _hRepo.GetHotelFacilities(HotelId);

            hViewModel.HotelRoomTypes = _hRepo.GetHotelRoomTypeByHotelId(HotelId);

            hViewModel.Images = _aRepo.GetImagesByRefType(HotelId, (int)Attachment.Hotel);

            hViewModel.Hotel.HotelFacilityDetails = hViewModel.HotelFacilityDetails;
            hViewModel.Hotel.RoomTypeDetails      = hViewModel.HotelRoomTypes;
            hViewModel.Hotel.Images = hViewModel.Images;
            //  GenerateHotel_PDF(hViewModel.Hotel);

            return(View("HotelView", hViewModel));
        }
Пример #3
0
        public PartialViewResult GetSearchSightSeeingDetails(SightSeeingViewModel sViewModel)
        {
            AccessoriesRepo _aRepo = new AccessoriesRepo();

            try
            {
                bool IsExtraChild = false;

                decimal cost = 0;

                decimal Extracost = 0;

                decimal Extra = 0;

                //int OccupancyValueCount = 0;

                decimal ExtraPeopleCost = 0;

                decimal ExtraChildCost = 0;

                decimal CheckBudget = sViewModel.SightSeeing.Budget;

                sViewModel.SightSeeings = _sRepo.GetSearchSightSeeingDetails(sViewModel.SightSeeing, IsExtraChild, (int)OccupancyType.Room);


                int TotalAdultCount = sViewModel.SightSeeing.AdultCount;

                foreach (var item in sViewModel.SightSeeings.Select(a => new { a.SightSeeingId }).Distinct())
                {
                    if (sViewModel.SightSeeing.ChildCount != 0)
                    {
                        IsExtraChild = true;

                        sViewModel.SightSeeingSearchExtraChildList = _sRepo.GetSearchSightSeeingDetails(sViewModel.SightSeeing, IsExtraChild, (int)OccupancyType.Extra);

                        if (sViewModel.SightSeeingSearchExtraChildList.Count > 0)
                        {
                            ExtraChildCost = sViewModel.SightSeeing.ChildCount * (sViewModel.SightSeeingSearchExtraChildList.Where(a => a.SightSeeingId == item.SightSeeingId).Select(a => a.NetRate).FirstOrDefault());
                        }
                        else
                        {
                            decimal singlePeopleCost = sViewModel.SightSeeings.Where(b => b.SightSeeingId == item.SightSeeingId && b.OccupancyValue == 1).Select(a => a.NetRate).FirstOrDefault();

                            ExtraChildCost = sViewModel.SightSeeing.ChildCount * singlePeopleCost;
                        }
                    }

                    string SightSeeingName = " ";
                    string Location        = "";
                    string Description     = " ";
                    string VisitTime       = "";
                    string Highlights      = "";
                    string Duration        = "";
                    int    SightSeeingId   = 0;

                    foreach (var i in sViewModel.SightSeeings.Where(a => a.SightSeeingId == item.SightSeeingId).OrderByDescending(s => s.OccupancyValue))
                    {
                        if (i.OccupancyValue <= sViewModel.SightSeeing.AdultCount)
                        {
                            if (i.OccupancyValue == sViewModel.SightSeeing.AdultCount)
                            {
                                cost = i.NetRate;

                                sViewModel.SightSeeing.AdultCount = 0;
                            }
                            else
                            {
                                while (sViewModel.SightSeeing.AdultCount >= i.OccupancyValue)
                                {
                                    int remains = sViewModel.SightSeeing.AdultCount - i.OccupancyValue;

                                    Extra = i.NetRate;

                                    sViewModel.SightSeeing.AdultCount = remains;

                                    Extracost += Extra;
                                }
                            }

                            SightSeeingName = i.SightSeeingName;

                            Location = i.location;

                            Description = i.Description;

                            VisitTime = i.VisitTime;

                            Highlights = i.Highlights;

                            Duration = i.Duration;

                            SightSeeingId = i.SightSeeingId;

                            sViewModel.Images = i.Images;
                        }
                    }

                    if (sViewModel.SightSeeing.AdultCount != 0)
                    {
                        IsExtraChild = false;

                        sViewModel.SightSeeingSearchExtraAdultList = _sRepo.GetSearchSightSeeingDetails(sViewModel.SightSeeing, IsExtraChild, (int)OccupancyType.Extra);

                        if (sViewModel.SightSeeingSearchExtraAdultList.Count > 0)
                        {
                            ExtraPeopleCost = sViewModel.SightSeeing.AdultCount * (sViewModel.SightSeeingSearchExtraAdultList.Where(a => a.SightSeeingId == item.SightSeeingId).Select(a => a.NetRate).FirstOrDefault());
                        }
                        else
                        {
                            decimal singlePeopleCost = sViewModel.SightSeeings.Where(b => b.SightSeeingId == item.SightSeeingId && b.OccupancyValue == 1).Select(a => a.NetRate).FirstOrDefault();

                            ExtraPeopleCost = sViewModel.SightSeeing.AdultCount * singlePeopleCost;
                        }
                    }


                    decimal NetRate = cost + Extracost + ExtraPeopleCost + ExtraChildCost;

                    SightSeeingInfo info = new SightSeeingInfo();

                    info.SightSeeingName = SightSeeingName;

                    info.location = Location;

                    info.VisitTime = VisitTime;

                    info.Highlights = Highlights;

                    info.Duration = Duration;

                    info.SightSeeingId = SightSeeingId;

                    info.Images = sViewModel.Images;

                    if (CheckBudget != 0)
                    {
                        if (CheckBudget > NetRate)
                        {
                            info.NetRate = NetRate;
                            sViewModel.SightSeeingSearchList.Add(info);
                        }
                    }
                    else
                    {
                        info.NetRate = NetRate;
                        sViewModel.SightSeeingSearchList.Add(info);
                    }

                    sViewModel.SightSeeing.AdultCount = TotalAdultCount;

                    NetRate = 0; cost = 0; Extracost = 0; ExtraPeopleCost = 0; ExtraChildCost = 0;
                }
            }

            catch (Exception ex)
            {
                sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("Package Controller - GetPackage" + ex.ToString());
            }

            TempData["sViewModel"] = sViewModel;

            return(PartialView("_SearchSightSeeingDetails", sViewModel));
        }
Пример #4
0
 public AccessoriesController()
 {
     _aRepo = new AccessoriesRepo();
 }
Пример #5
0
        public SightSeeingInfo GetsightSeeingBasicDetailsValues(DataRow dr)
        {
            AccessoriesRepo _aRepo = new AccessoriesRepo();
            SightSeeingInfo sInfo  = new SightSeeingInfo();

            sInfo.SightSeeingId = Convert.ToInt32(dr["SightSeeingId"]);

            if (!dr.IsNull("SightSeeingName"))
            {
                sInfo.SightSeeingName = Convert.ToString(dr["SightSeeingName"]);
            }

            if (!dr.IsNull("CityId"))
            {
                sInfo.CityId = Convert.ToInt32(dr["CityId"]);
            }

            if (!dr.IsNull("location"))
            {
                sInfo.location = Convert.ToString(dr["location"]);
            }

            //if (!dr.IsNull("AdultCount"))
            //    sInfo.AdultCount = Convert.ToInt32(dr["AdultCount"]);

            //if (!dr.IsNull("ChildCount"))
            //    sInfo.ChildCount = Convert.ToInt32(dr["ChildCount"]);

            if (!dr.IsNull("Description"))
            {
                sInfo.Description = Convert.ToString(dr["Description"]);
            }

            if (!dr.IsNull("VisitTime"))
            {
                sInfo.VisitTime = Convert.ToString(dr["VisitTime"]);
            }

            if (!dr.IsNull("Highlights"))
            {
                sInfo.Highlights = Convert.ToString(dr["Highlights"]);
            }

            if (!dr.IsNull("Duration"))
            {
                sInfo.Duration = Convert.ToString(dr["Duration"]);
            }

            if (!dr.IsNull("OccupancyValue"))
            {
                sInfo.OccupancyValue = Convert.ToInt32(dr["OccupancyValue"]);
            }

            if (!dr.IsNull("OccupancyId"))
            {
                sInfo.OccupancyId = Convert.ToInt32(dr["OccupancyId"]);
            }

            if (!dr.IsNull("SightSeeingTariffId"))
            {
                sInfo.SightSeeingTariffId = Convert.ToInt32(dr["SightSeeingTariffId"]);
            }

            if (!dr.IsNull("NetRate"))
            {
                sInfo.NetRate = Convert.ToDecimal(dr["NetRate"]);
            }

            sInfo.Images = _aRepo.GetImagesByRefType(sInfo.SightSeeingId, (int)Attachment.SightSeeing);
            return(sInfo);
        }