Esempio n. 1
0
        public void RecalcuateTourInfo(UserTourInformation tourdata)
        {
            try
            {
                List <GetOrderOfAttractionVisit> storedAttractinInfo =
                    userDal.User_GetUserStoredAttractinInfo(tourdata.UserTripId, tourdata.UserId);

                List <UserTable_UpdatedBreaksTemp> breakInformation = userDal.User_RequestedBreaks(tourdata.UserTripId);

                List <userTable_OnlyId> userattraction = new List <userTable_OnlyId>();


                List <UserTable_UpdatedBreaks> breakInfo = breakInformation
                                                           .Where(y => !string.IsNullOrEmpty(y.UpdateDayEndTime) &&
                                                                  !string.IsNullOrEmpty(y.UpdateDayStartTime) &&
                                                                  !string.IsNullOrEmpty(y.UpdatedBreakTime) &&
                                                                  !string.IsNullOrEmpty(y.UpdatedDinnerTime) &&
                                                                  !string.IsNullOrEmpty(y.UpdatedLunchTime)
                                                                  ).Select(x => new UserTable_UpdatedBreaks
                {
                    IsUserInterestedBreak       = x.IsUserInterestedBreak,
                    IsUserInterestedDayBreak    = x.IsUserInterestedDayBreak,
                    UpdateDayStartTime          = TimeSpan.Parse(x.UpdateDayStartTime),
                    UpdatedDinnerTime           = TimeSpan.Parse(x.UpdatedDinnerTime),
                    UpdatedLunchTime            = TimeSpan.Parse(x.UpdatedLunchTime),
                    IsUserInterestedLunchBreak  = x.IsUserInterestedLunchBreak,
                    UpdatedBreakTime            = TimeSpan.Parse(x.UpdatedBreakTime),
                    UpdateDayEndTime            = TimeSpan.Parse(x.UpdateDayEndTime),
                    IsUserInterestedDinnerBreak = x.IsUserInterestedDinnerBreak,
                    RequestDate               = Convert.ToDateTime(x.RequestDate),
                    IsBreakAdded              = x.IsBreakAdded,
                    BreakAttractionId         = x.BreakAttractionId,
                    IsLunchAdded              = x.IsLunchAdded,
                    LunchAttractionId         = x.LunchAttractionId,
                    IsDinnerAdded             = x.IsDinnerAdded,
                    DinnerAttractionId        = x.DinnerAttractionId,
                    IsUserInterestedBreakFast = x.IsUserInterestedBreakFast,
                    UpdatedBreakFastTime      = TimeSpan.Parse(x.UpdatedBreakFastTime),
                    IsBreakFastAdded          = x.IsBreakFastAdded,
                    BreakFastAttractionId     = x.BreakFastAttractionId,
                    IsDayBreakAdded           = x.IsDayBreakAdded,
                    DayBreakAttractionId      = x.DayBreakAttractionId,
                    NoOfCars                      = x.NoOfCars,
                    AverageMileage                = x.AverageMileage,
                    BreakExpense                  = x.BreakExpense,
                    BreakFastExpense              = x.BreakFastExpense,
                    CarRentalExpense              = x.CarRentalExpense,
                    DayBreakExpense               = x.DayBreakExpense,
                    LunchExpense                  = x.LunchExpense,
                    NoOfRooms                     = x.NoOfRooms,
                    DinnerExpense                 = x.DinnerExpense,
                    IsNoOfCarsUserUpdated         = x.IsNoOfCarsUserUpdated,
                    IsAverageMileageUserUpdated   = x.IsAverageMileageUserUpdated,
                    IsCarRentalExpenseUserUpdated = x.IsCarRentalExpenseUserUpdated,
                    IsBreakFastExpenseUserUpdated = x.IsBreakFastExpenseUserUpdated,
                    IsLunchExpenseUserUpdated     = x.IsLunchExpenseUserUpdated,
                    IsBreakExpenseUserUpdated     = x.IsBreakExpenseUserUpdated,
                    IsDinnerExpenseUserUpdated    = x.IsDinnerExpenseUserUpdated,
                    IsDayBreakExpenseUserUpdated  = x.IsDayBreakExpenseUserUpdated,
                    IsNoOfRoomsUserUpdated        = x.IsNoOfRoomsUserUpdated
                }).ToList();



                using (AttractionInformationBinding attractionInformation = new AttractionInformationBinding())
                {
                    attractionInformation.UserRequestedAttractionInformation(tourdata.TravelModeId,

                                                                             storedAttractinInfo, tourdata.CountryId,
                                                                             breakInfo,
                                                                             tourdata.UserTripId);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public JsonResult Public_GetOrderOfAttractionVisit(InputParameters inputParameters)
        {
            List <GetOrderOfAttractionVisit> listGetOrderOfAttractionVisit = new List <GetOrderOfAttractionVisit>();


            if (inputParameters.ListGroupWithDateAttractions != null)
            {
                foreach (GroupWithDateAttractions _GroupWithDateAttractions in inputParameters.ListGroupWithDateAttractions)
                {
                    foreach (GetOrderOfAttractionVisit _GetOrderOfAttractionVisit in _GroupWithDateAttractions.ListGetOrderOfAttractionVisit)
                    {
                        listGetOrderOfAttractionVisit.Add(_GetOrderOfAttractionVisit);
                    }
                }
            }

            List <UserTable_UpdatedBreaks> userTable_UpdatedBreaks = userTable_UpdatedBreaks = new List <UserTable_UpdatedBreaks>();

            if (inputParameters.UpdatedBreaks != null)
            {
                userTable_UpdatedBreaks = inputParameters.UpdatedBreaks.Select(x => new UserTable_UpdatedBreaks
                {
                    IsUserInterestedBreak       = x.IsUserInterestedBreak,
                    IsUserInterestedDayBreak    = x.IsUserInterestedDayBreak,
                    UpdateDayStartTime          = TimeSpan.Parse(x.UpdateDayStartTime),
                    UpdatedDinnerTime           = TimeSpan.Parse(x.UpdatedDinnerTime),
                    UpdatedLunchTime            = TimeSpan.Parse(x.UpdatedLunchTime),
                    IsUserInterestedLunchBreak  = x.IsUserInterestedLunchBreak,
                    UpdatedBreakTime            = TimeSpan.Parse(x.UpdatedBreakTime),
                    UpdateDayEndTime            = TimeSpan.Parse(x.UpdateDayEndTime),
                    IsUserInterestedDinnerBreak = x.IsUserInterestedDinnerBreak,
                    RequestDate               = Convert.ToDateTime(x.RequestDate),
                    IsBreakAdded              = x.IsBreakAdded,
                    BreakAttractionId         = x.BreakAttractionId,
                    IsLunchAdded              = x.IsLunchAdded,
                    LunchAttractionId         = x.LunchAttractionId,
                    IsDinnerAdded             = x.IsDinnerAdded,
                    DinnerAttractionId        = x.DinnerAttractionId,
                    IsUserInterestedBreakFast = x.IsUserInterestedBreakFast,
                    UpdatedBreakFastTime      = TimeSpan.Parse(x.UpdatedBreakFastTime),
                    IsBreakFastAdded          = x.IsBreakFastAdded,
                    BreakFastAttractionId     = x.BreakFastAttractionId,
                    IsDayBreakAdded           = x.IsDayBreakAdded,
                    DayBreakAttractionId      = x.DayBreakAttractionId,
                    NoOfCars                      = x.NoOfCars,
                    AverageMileage                = x.AverageMileage,
                    BreakExpense                  = x.BreakExpense,
                    BreakFastExpense              = x.BreakFastExpense,
                    CarRentalExpense              = x.CarRentalExpense,
                    DayBreakExpense               = x.DayBreakExpense,
                    LunchExpense                  = x.LunchExpense,
                    NoOfRooms                     = x.NoOfRooms,
                    DinnerExpense                 = x.DinnerExpense,
                    IsNoOfCarsUserUpdated         = x.IsNoOfCarsUserUpdated,
                    IsAverageMileageUserUpdated   = x.IsAverageMileageUserUpdated,
                    IsCarRentalExpenseUserUpdated = x.IsCarRentalExpenseUserUpdated,
                    IsBreakFastExpenseUserUpdated = x.IsBreakFastExpenseUserUpdated,
                    IsLunchExpenseUserUpdated     = x.IsLunchExpenseUserUpdated,
                    IsBreakExpenseUserUpdated     = x.IsBreakExpenseUserUpdated,
                    IsDinnerExpenseUserUpdated    = x.IsDinnerExpenseUserUpdated,
                    IsDayBreakExpenseUserUpdated  = x.IsDayBreakExpenseUserUpdated,
                    IsNoOfRoomsUserUpdated        = x.IsNoOfRoomsUserUpdated
                }).ToList();
            }


            var listGroupWithDateAttractions = new List <GroupWithDateAttractions>();

            using (AttractionInformationBinding attractionInformationBinding = new AttractionInformationBinding())
            {
                listGroupWithDateAttractions =
                    attractionInformationBinding.UserRequestedAttractionInformation(inputParameters.TravelModeId,
                                                                                    listGetOrderOfAttractionVisit,
                                                                                    inputParameters.CountryId, userTable_UpdatedBreaks, userEntity.UserTripId);
            }

            return(jsonReturn.JsonResult <GroupWithDateAttractions>(listGroupWithDateAttractions));
        }