Exemplo n.º 1
0
        private LohanaPackageTariffSearchInfo GetLohanaPackageTariffItienarySearchDetailsValues(DataRow dr)
        {
            LohanaPackageTariffSearchInfo LohanaPackageTariffItienarySearch = new LohanaPackageTariffSearchInfo();

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

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

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


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

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

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

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

            return(LohanaPackageTariffItienarySearch);
        }
Exemplo n.º 2
0
        private LohanaPackageTariffSearchInfo GetLohanaPackageTariffBasicDetailsValues(DataRow dr)
        {
            LohanaPackageTariffSearchInfo LohanaPackageTariffSearchBasicDetail = new LohanaPackageTariffSearchInfo();

            if (!dr.IsNull("FinalCost"))
            {
                LohanaPackageTariffSearchBasicDetail.Cost = Convert.ToDecimal(dr["FinalCost"]);
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(LohanaPackageTariffSearchBasicDetail);
        }
Exemplo n.º 3
0
        //Get LohanaPackage Tariff Basic Detail

        public List <LohanaPackageTariffSearchInfo> GetLohanaPackageTariffBasicDetails(LohanaPackageTariffSearchInfo searchInfo, bool IsExtraChild, int OccupancyType)
        {
            var count = 1;

            List <SqlParameter> sqlParam = new List <SqlParameter>();

            searchInfo.DayDuration = searchInfo.NightDuration + count;

            List <LohanaPackageTariffSearchInfo> LPTSearchDetails = new List <LohanaPackageTariffSearchInfo>();

            sqlParam.Add(new SqlParameter("@PackageTypeId", searchInfo.PackageTypeId));

            sqlParam.Add(new SqlParameter("@OccupancyId", searchInfo.OccupancyId));

            sqlParam.Add(new SqlParameter("@CountryId", searchInfo.CountryId));

            sqlParam.Add(new SqlParameter("@StateId", searchInfo.StateId));

            sqlParam.Add(new SqlParameter("@CityId", searchInfo.CityId));

            sqlParam.Add(new SqlParameter("@OccupancyType", OccupancyType));

            sqlParam.Add(new SqlParameter("@IsExtraChild", IsExtraChild));

            sqlParam.Add(new SqlParameter("@DayDuration", searchInfo.DayDuration));

            sqlParam.Add(new SqlParameter("@NightDuration", searchInfo.NightDuration));

            sqlParam.Add(new SqlParameter("@CheckInDate", searchInfo.CheckInDate));

            sqlParam.Add(new SqlParameter("@CheckOutDate", searchInfo.CheckOutDate));


            DataSet ds = _sqlHelper.ExecuteDataSet(sqlParam, Storeprocedures.spGetLohanaPackageTariffDetailsSearch.ToString(), CommandType.StoredProcedure);

            DataTable dt1 = ds.Tables[0];

            if (dt1 != null && dt1.Rows.Count > 0)
            {
                foreach (DataRow dr in dt1.Rows)
                {
                    LPTSearchDetails.Add(GetLohanaPackageTariffBasicDetailsValues(dr));
                }
            }
            return(LPTSearchDetails);
        }
        public PartialViewResult GetLohanaPackageTariffSearch(LohanaPackageTariffSearchViewModel lptsViewModel)
        {
            try
            {
                bool IsExtraChild = false;

                decimal cost = 0;

                decimal Extracost = 0;

                //int OccupancyValueCount = 0;

                decimal ExtraPeopleCost = 0;

                decimal ExtraChildCost = 0;

                decimal Extra = 0;

                //lptsViewModel.LohanaPackageTariffSearch.CheckOutDate = lptsViewModel.LohanaPackageTariffSearch.CheckInDate.AddDays(lptsViewModel.LohanaPackageTariffSearch.DayDuration);

                lptsViewModel.LohanaPackageTariffSearchList = _lptsRepo.GetLohanaPackageTariffBasicDetails(lptsViewModel.LohanaPackageTariffSearch, IsExtraChild, (int)OccupancyType.Room);
                //lptsViewModel.LohanaPackageTariffSearchList

                int TotalAdultCount = lptsViewModel.LohanaPackageTariffSearch.AdultCount;

                foreach (var item in lptsViewModel.LohanaPackageTariffSearchList.Select(a => new { a.LohanaPackageTariffId, a.RoomTypeId }).Distinct())
                {
                    if (lptsViewModel.LohanaPackageTariffSearch.ChildCount != 0)
                    {
                        IsExtraChild = true;

                        lptsViewModel.LohanaPackageTariffSearchExtraChildList = _lptsRepo.GetLohanaPackageTariffBasicDetails(lptsViewModel.LohanaPackageTariffSearch, IsExtraChild, (int)OccupancyType.Extra);


                        if (lptsViewModel.LohanaPackageTariffSearchExtraChildList.Count > 0)
                        {
                            ExtraChildCost = lptsViewModel.LohanaPackageTariffSearch.ChildCount * (lptsViewModel.LohanaPackageTariffSearchExtraChildList.Where(a => a.LohanaPackageTariffId == item.LohanaPackageTariffId).Select(a => a.Cost).FirstOrDefault());
                        }
                        else
                        {
                            decimal singlePeopleCost = lptsViewModel.LohanaPackageTariffSearchList.Where(b => b.LohanaPackageTariffId == item.LohanaPackageTariffId && b.OccupancyValue == 1).Select(a => a.Cost).FirstOrDefault();

                            ExtraChildCost = lptsViewModel.LohanaPackageTariffSearch.ChildCount * singlePeopleCost;
                        }
                    }

                    string PackageName = " ";

                    string PackageTypeName = " ";

                    int LohanaPackageTariffId = 0;

                    int DayDuration = 0;

                    int NightDuration = 0;

                    string LPTDuration = "";

                    int PackageTypeId = 0;

                    int CountryId = 0;

                    int StateId = 0;

                    int CityId = 0;

                    int RoomTypeId = 0;

                    int OccupancyId = 0;

                    string OccupanyName = "";

                    string CountryName = "";

                    string StateName = "";

                    string CityName = "";

                    decimal Cost = 0;

                    // OccupancyValueCount = lptsViewModel.LohanaPackageTariffSearchRoomList.Where(a => a.LohanaPackageTariffId == item.LohanaPackageTariffId).Select(b => b.OccupancyValue).Sum();

                    //for (int k = 0; k <= 1; k++)
                    //{
                    //if (OccupancyValueCount >= lptsViewModel.LohanaPackageTariffSearch.AdultCount)
                    //{


                    foreach (var i in lptsViewModel.LohanaPackageTariffSearchList.Where(a => a.LohanaPackageTariffId == item.LohanaPackageTariffId && a.RoomTypeId == item.RoomTypeId).OrderByDescending(s => s.OccupancyValue))
                    //foreach (var i in lptsViewModel.LohanaPackageTariffSearchList)

                    {
                        if (i.OccupancyValue <= lptsViewModel.LohanaPackageTariffSearch.AdultCount)
                        {
                            if (i.OccupancyValue == lptsViewModel.LohanaPackageTariffSearch.AdultCount)
                            {
                                //cost = i.Cost * lptsViewModel.LohanaPackageTariffSearch.AdultCount;
                                cost = i.Cost;

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

                                    //Extra = i.Cost * i.OccupancyValue;
                                    Extra = i.Cost;

                                    lptsViewModel.LohanaPackageTariffSearch.AdultCount = remains;

                                    Extracost += Extra;
                                }
                            }
                        }

                        LohanaPackageTariffId = i.LohanaPackageTariffId;

                        PackageName = i.PackageName;

                        PackageTypeName = i.PackageTypeName;

                        CountryId = i.CountryId;

                        StateId = i.StateId;

                        CityId = i.CityId;

                        PackageTypeId = i.PackageTypeId;

                        RoomTypeId = i.RoomTypeId;

                        OccupancyId = i.OccupancyId;

                        OccupanyName = i.OccupancyName;

                        CountryName = i.CountryName;

                        StateName = i.StateName;

                        CityName = i.CityName;

                        DayDuration = i.DayDuration;

                        NightDuration = i.NightDuration;

                        LPTDuration = i.LPTDuration;

                        Cost = i.Cost;
                    }
                    //}


                    if (lptsViewModel.LohanaPackageTariffSearch.AdultCount != 0)
                    {
                        //extra adult cost

                        IsExtraChild = false;

                        // int RemainingPeople = lptsViewModel.LohanaPackageTariffSearch.AdultCount - OccupancyValueCount;

                        lptsViewModel.LohanaPackageTariffSearchExtraList = _lptsRepo.GetLohanaPackageTariffBasicDetails(lptsViewModel.LohanaPackageTariffSearch, IsExtraChild, (int)OccupancyType.Extra);

                        if (lptsViewModel.LohanaPackageTariffSearchExtraList.Count > 0)
                        {
                            ExtraPeopleCost = lptsViewModel.LohanaPackageTariffSearch.AdultCount * (lptsViewModel.LohanaPackageTariffSearchExtraList.Where(a => a.LohanaPackageTariffId == item.LohanaPackageTariffId).Select(a => a.Cost).FirstOrDefault());
                        }

                        else
                        {
                            decimal singlePeopleCost = lptsViewModel.LohanaPackageTariffSearchList.Where(b => b.LohanaPackageTariffId == item.LohanaPackageTariffId && b.OccupancyValue == 1).Select(a => a.Cost).FirstOrDefault();

                            ExtraPeopleCost = lptsViewModel.LohanaPackageTariffSearch.AdultCount * singlePeopleCost;
                        }


                        //lptsViewModel.LohanaPackageTariffSearch.AdultCount = OccupancyValueCount;
                    }

                    //   }

                    decimal PackageCost = cost + Extracost + ExtraPeopleCost + ExtraChildCost;

                    if (PackageCost != 0)
                    {
                        LohanaPackageTariffSearchInfo info = new LohanaPackageTariffSearchInfo();

                        // info.SupplierName = Suppliername;

                        info.PackageTypeName = PackageTypeName;

                        info.PackageName = PackageName;

                        info.Cost = PackageCost;

                        info.LohanaPackageTariffId = LohanaPackageTariffId;

                        info.CountryId = CountryId;

                        info.StateId = StateId;

                        info.CityId = CityId;

                        info.PackageTypeId = PackageTypeId;

                        info.OccupancyId = OccupancyId;

                        info.OccupancyName = OccupanyName;

                        info.RoomTypeId = RoomTypeId;

                        info.CountryName = CountryName;

                        info.StateName = StateName;

                        info.CityName = CityName;

                        info.DayDuration = DayDuration;

                        info.NightDuration = NightDuration;

                        info.LPTDuration = LPTDuration;

                        lptsViewModel.LohanaPackageTariffSearchRoomList.Add(info);
                    }

                    lptsViewModel.LohanaPackageTariffSearch.AdultCount = TotalAdultCount;

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

                Logger.Debug("LohanaPackageTariffSearch Controller GetLohanaPackageTariffSearch");
            }
            catch (Exception ex)
            {
                lptsViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("LohanaPackageTariffSearch Controller - GetLohanaPackageTariffSearch" + ex.ToString());
            }

            TempData["lptsViewModel"] = lptsViewModel;

            return(PartialView("_LohanaPackageTariffSearchDetails", lptsViewModel));
        }
Exemplo n.º 5
0
        public LohanaPackageTariffSearchViewModel()
        {
            FriendlyMessage = new List <FriendlyMessage>();

            LohanaPackageTariffSearch = new LohanaPackageTariffSearchInfo();

            LohanaPackageTariffSearchList = new List <LohanaPackageTariffSearchInfo>();

            LohanaPackageTariffRoot = new LohanaPackageTariffRootInfo();

            LohanaPackageTariffRootList = new List <LohanaPackageTariffRootInfo>();

            LohanaPackageTariff = new LohanaPackageTariffInfo();

            LohanaPackageTariffList = new List <LohanaPackageTariffInfo>();

            HotelTariff = new HotelTariffInfo();

            HotelTariffs = new List <HotelTariffInfo>();

            PackageType = new PackageTypeInfo();

            PackageTypes = new List <PackageTypeInfo>();

            Hotel = new HotelInfo();

            Hotels = new List <HotelInfo>();

            RoomType = new RoomTypeInfo();

            Cities = new List <CityInfo>();

            City = new CityInfo();

            Pager = new PaginationInfo();

            HotelTariffDate = new HotelTariffDateDetailsInfo();

            HotelTariffDates = new List <HotelTariffDateDetailsInfo>();

            HotelTariffDuration = new HotelTariffDurationDetailsInfo();

            HotelTariffDurations = new List <HotelTariffDurationDetailsInfo>();

            HotelTariffPrice = new HotelTariffPriceDetailsInfo();

            HotelTariffPrices = new List <HotelTariffPriceDetailsInfo>();

            HotelTariffRoom = new HotelTariffRoomDetailsInfo();

            HotelTariffRooms = new List <HotelTariffRoomDetailsInfo>();


            LohanaPackageTariffSearchRoomList = new List <LohanaPackageTariffSearchInfo>();

            LohanaPackageTariffSearchExtraChildList = new List <LohanaPackageTariffSearchInfo>();

            LohanaPackageTariffSearchExtraList = new List <LohanaPackageTariffSearchInfo>();

            LohanaPackageTariffSearchFilter = new LohanaPackageTariffSearchInfo();

            LohanaPackageTariffSearchFilterList = new List <LohanaPackageTariffSearchInfo>();


            LohanaPackageItienaryList = new List <LohanaPackageTariffSearchInfo>();


            Enquiry = new EnquiryInfo();
        }