示例#1
0
        public JsonResult GetSightSeeing(SightSeeingViewModel sViewModel)
        {
            PaginationInfo pager = new PaginationInfo();

            pager = sViewModel.Pager;

            PaginationViewModel pViewModel = new PaginationViewModel();

            try
            {
                //Modification by swapali | Date:28/06/2017
                pViewModel.dt = _sRepo.GetSightSeeing(sViewModel.SightSeeing.SightSeeingName, sViewModel.SightSeeing.CityId, ref pager);

                pViewModel.Pager = pager;

                Logger.Debug("SightSeeing Controller GetSightSeeing");
            }

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

                Logger.Error("SightSeeing Controller - GetSightSeeing" + ex.ToString());
            }

            return(Json(JsonConvert.SerializeObject(pViewModel), JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult Index(SightSeeingViewModel sViewModel)
        {
            if (TempData["sViewModel"] != null)
            {
                sViewModel = (SightSeeingViewModel)TempData["sViewModel"];
            }
            sViewModel.Cities = _sRepo.drpGetCountryStateCity();

            Set_Date_Session(sViewModel.SightSeeing);

            return(View("Index", sViewModel));
        }
示例#3
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));
        }
示例#4
0
        public ActionResult Search(SightSeeingViewModel sViewModel)
        {
            try
            {
                Set_Date_Session(sViewModel.SightSeeing);

                sViewModel.Cities = _sRepo.drpGetCountryStateCity();

                Logger.Debug("SightSeeing Controller Search");
            }
            catch (Exception ex)
            {
                sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("SightSeeing Controller - Search " + ex.Message);
            }
            return(View("Search", sViewModel));
        }
示例#5
0
        public JsonResult CheckSightSeeingNameExist(string sightseeingid)
        {
            bool check = false;

            SightSeeingViewModel sViewModel = new SightSeeingViewModel();

            try
            {
                check = _sRepo.CheckSightSeeingNameExist(sightseeingid);

                Logger.Debug("SightSeeing Controller CheckSightSeeingNameExist");
            }
            catch (Exception ex)
            {
                Logger.Error("SightSeeing Controller - CheckSightSeeingNameExist" + ex.Message);
            }

            return(Json(check, JsonRequestBehavior.AllowGet));
        }
示例#6
0
        public ActionResult GetSightSeeingById(SightSeeingViewModel sViewModel)
        {
            try
            {
                sViewModel.SightSeeing = _sRepo.GetSightSeeingById(sViewModel.Filter.SightSeeingId);

                Logger.Debug("SightSeeing Controller GetSightSeeingById");
            }
            catch (Exception ex)
            {
                sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("SightSeeing Controller - GetUserById" + ex.ToString());
            }

            TempData["sViewModel"] = sViewModel;

            return(Index(sViewModel));
        }
示例#7
0
        public JsonResult Insert(SightSeeingViewModel sViewModel)
        {
            try
            {
                Set_Date_Session(sViewModel.SightSeeing);

                sViewModel.SightSeeing.SightSeeingId = _sRepo.Insert(sViewModel.SightSeeing);

                sViewModel.FriendlyMessage.Add(MessageStore.Get("SS01"));

                Logger.Debug("SightSeeing Controller Insert");
            }
            catch (Exception ex)
            {
                sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("SightSeeing Controller - Insert " + ex.Message);
            }

            return(Json(sViewModel));
        }
示例#8
0
        public JsonResult Update(SightSeeingViewModel sViewModel)
        {
            try
            {
                Set_Date_Session(sViewModel.SightSeeing);

                _sRepo.UpdateSightSeeing(sViewModel.SightSeeing);

                sViewModel.FriendlyMessage.Add(MessageStore.Get("SS02"));

                Logger.Debug("SightSeeing Controller Update");
            }
            catch (Exception ex)
            {
                sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("SightSeeing Controller - UpdateSightSeeing  " + ex.Message);
            }

            return(Json(sViewModel));
        }
示例#9
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));
        }
示例#10
0
 public ActionResult SearchSightSeeing(SightSeeingViewModel sViewModel)
 {
     return(View("SightSeeingSearch", sViewModel));
 }