public ActionResult Contact(int?ID)
 {
     if (ID.HasValue)
     {
         if (TempData["ViewData"] != null)
         {
             ViewData = (ViewDataDictionary)TempData["ViewData"];
         }
         Contact contact = new Contact();
         var     shop    = LS.GetFirst <Shop>(x => x.ID == ID);
         if (shop != null)
         {
             contact.DropDownItems = new List <string> {
                 RP.T("Views.Shared.Contact.DropDownOneText").ToString(),
                 RP.T("Views.Shared.Contact.DropDownTwoText").ToString(),
                 RP.T("Views.Shared.Contact.DropDownThreeText").ToString(),
             };
             if (!string.IsNullOrEmpty(shop.Theme))
             {
                 this.HttpContext.Items["ShopTheme"] = shop.Theme;
             }
             contact.Shop = shop;
             return(View(contact));
         }
     }
     return(Redirect("~/Landing/Main/Index.html"));
 }
        public ActionResult _GetShopInfo(int shopID)
        {
            var culture = new System.Globalization.CultureInfo("he-IL");
            var data    = LS.GetFirst <Shop>(x => x.ID == shopID);

            UserActivityService.InsertShopOpen(LS.CurrentUser.ID, shopID
                                               , Request.RawUrl,
                                               Request.UrlReferrer != null ? Request.UrlReferrer.OriginalString : null
                                               , LS.GetUser_IP(Request));
            data.ShopCommentModels = ShoppingService.GetShopComments(shopID);
            //data.ShopType = LS.Get<ShopType>()
            //    .FirstOrDefault(x => data.ShopTypeIDs!= null && data.ShopTypeIDs.Contains(x.ID.ToString() ) );

            var curdate  = DateTime.Now.Date;
            var lastdate = curdate.AddDays(7);

            data.WorkTimes = LS.CurrentEntityContext.ShopWorkTimes.Where(x => x.ShopID == shopID && x.Active &&
                                                                         (!x.IsSpecial || (x.Date >= curdate && x.Date <= lastdate)))
                             .OrderBy(x => x.IsSpecial).ThenBy(x => x.Day).ThenBy(x => x.Date)
                             .Select(x => new ShipTimeModel()
            {
                Date        = x.Date,
                Day         = x.Day,
                TimeFromInt = x.TimeFrom,
                TimeToInt   = x.TimeTo,
                IsSpecial   = x.IsSpecial,
            }).ToList();

            foreach (var t in data.WorkTimes)
            {
                t.DayStr       = culture.DateTimeFormat.GetDayName(t.Day);
                t.TimeFromeStr = TimeSpan.FromMinutes(t.TimeFromInt).ToString("hh':'mm"); //ntToTime(t.TimeFromInt);
                t.TimeToStr    = TimeSpan.FromMinutes(t.TimeToInt).ToString("hh':'mm");
                t.DateStr      = t.Date.ToString("dd/MM");
            }

            data.ShipTimes = _db.ShopShipTimes.Where(x => x.ShopID == shopID && x.Active && !x.IsSpecial)
                             .Select(x => new ShipTimeModel()
            {
                Date        = x.Date,
                Day         = x.Day,
                TimeFromInt = x.TimeFrom,
                TimeToInt   = x.TimeTo,
            }).ToList();
            foreach (var t in data.ShipTimes)
            {
                t.DayStr       = t.DayStr = culture.DateTimeFormat.GetDayName(t.Day);
                t.TimeFromeStr = TimeSpan.FromMinutes(t.TimeFromInt).ToString("hh':'mm");
                t.TimeToStr    = TimeSpan.FromMinutes(t.TimeToInt).ToString("hh':'mm");
            }

            if (!string.IsNullOrEmpty(data.Theme))
            {
                this.HttpContext.Items["ShopTheme"] = data.Theme;
            }

            return(PartialView("_ShopInfoPopup", data));
        }
        private void SetShopTheme(int shopId, HttpContextBase httpContext)
        {
            var shop = LS.GetFirst <Shop>(x => x.ID == shopId);

            if (shop != null && !string.IsNullOrEmpty(shop.Theme))
            {
                httpContext.Items["ShopTheme"] = shop.Theme;
            }
        }