Exemple #1
0
 public EventPaginationModel(EventViewType eventType, SiteDB dbInstance, int?pageIndex, int?pageSize)
 {
     base.PageIndex               = pageIndex.GetValueOrDefault(0);
     base.PageSize                = pageSize.GetValueOrDefault(DEFAULT_PAGE_SIZE);
     base.AdditionalData          = JsonConvert.SerializeObject(new { EventType = (int)eventType });
     this.EventType               = eventType;
     this._DBInstance             = dbInstance;
     this.SortedAndFilteredEvents = this._SortAndFilterEvents();
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult PaginateEvents(PaginationModel model)
        {
            // deserialize the data
            var additionalData = JsonConvert.DeserializeObject <Dictionary <string, int> >(model.AdditionalData);

            // cast the value to the event type we want
            EventViewType viewType = (EventViewType)additionalData["EventType"];

            return(PartialView(
                       "~/Views/Admin/EventsPaginationBody.cshtml",
                       new EventPaginationModel(viewType, db, model.PageIndex, model.PageSize)
                       ));
        }
Exemple #3
0
        public tbl_Domains SaveDomain(string address, string name, string phone, string consumerKey, string consumerSecret, string css, string defaultDesc,
                                      string keywords, int langID, string title, string desc, string domainName, string email, string googleAnalytics, string googleAnalyticsCode,
                                      bool googleAnalyticsVisible, string robots, string headline, int homePageID, int?launchYear, bool primaryDomain, string share, string twitterSecret,
                                      string twitterToken, string twitterUser, bool updateTwitter, bool isMailChimpEnabled, string mailChimpAPIKey, string mailChimpListID,
                                      bool isCommuniGatorEnabled, string communiGatorUser, string communiGatorPassword, EventViewType eventView, bool enableEventSale,
                                      bool enableProductSale, string theme, bool devMode, bool isCoockieConsentEnabled, bool customRouteHandler, int domainID = 0)
        {
            var domain = this.DbSet.FirstOrDefault(d => d.DomainID == domainID);

            if (domain == null)
            {
                domain = new tbl_Domains();
                this.Create(domain);
            }

            domain.DO_CompanyAddress   = address;
            domain.DO_CompanyName      = name;
            domain.DO_CompanyTelephone = phone;
            domain.DO_ConsumerKey      = consumerKey;
            domain.DO_ConsumerSecret   = consumerSecret;
            domain.DO_CSS = css;
            domain.DO_DefaultDescription = defaultDesc;
            domain.DO_DefaultKeywords    = keywords;
            domain.DO_DefaultLangID      = langID;
            domain.DO_DefaultTitle       = title;
            domain.DO_Description        = desc;
            domain.DO_Domain             = domainName ?? String.Empty;
            domain.DO_Email                  = email;
            domain.DO_GoogleAnalytics        = googleAnalytics ?? String.Empty;
            domain.DO_GoogleAnalyticsCode    = googleAnalyticsCode;
            domain.DO_GoogleAnalyticsVisible = googleAnalyticsVisible;
            domain.DO_Robots                 = robots;
            domain.DO_Headline               = headline;
            domain.DO_HomePageID             = homePageID;
            domain.DO_LaunchYear             = launchYear;
            domain.DO_PrimaryDomain          = primaryDomain;
            domain.DO_ShareThis              = share;
            domain.DO_TwitterSecret          = twitterSecret;
            domain.DO_TwitterToken           = twitterToken;
            domain.DO_TwitterUser            = twitterUser;
            domain.DO_UpdateTwitter          = updateTwitter;
            domain.DO_EnableMailChimp        = isMailChimpEnabled;
            domain.DO_MailChimpAPIKey        = mailChimpAPIKey;
            domain.DO_MailChimpListID        = mailChimpListID;
            domain.DO_EnableCommuniGator     = isCommuniGatorEnabled;
            domain.DO_CommuniGatorPassword   = communiGatorPassword;
            domain.DO_CommuniGatorUserName   = communiGatorUser;
            domain.DO_DefaultEventView       = (int)eventView;
            domain.DO_EnableEventSale        = enableEventSale;
            domain.DO_EnableProductSale      = enableProductSale;
            domain.DO_Theme                  = theme;
            domain.DO_DevelopmentMode        = devMode;
            domain.DO_IsCookieConsentEnabled = isCoockieConsentEnabled;
            domain.DO_CustomRouteHandler     = customRouteHandler;


            this.Context.SaveChanges();
            return(domain);
        }
Exemple #4
0
        public ActionResult GetEventView(EventViewType type, int categoryID)
        {
            if (type == EventViewType.Calendar)
                return PartialView("~/Views/Partials/EventsCalendar.cshtml");

            List<tbl_Products> products = new List<tbl_Products>();

            var category = ECommerceService.GetProdCategoryByID(categoryID);
            if (category != null)
                products = category.tbl_Products.GetWithContent(ProductType.Event).ToList();

            products = products.Where(p => p.tbl_ProductPrice.Any(pp => IsActual(pp))).ToList();
            return PartialView("EventsList", products);
        }
            public ViewHolder(View itemView, Action <Shoot> capture, Action <Shoot> edit, Action showmore, Action <Shoot> share, Action <string> entercode, EventViewType buttons, EventAdapter adpt, int tiletype) : base(itemView)
            {
                this.capture   = capture;
                this.edit      = edit;
                view           = itemView;
                this.buttons   = buttons;
                this.showmore  = showmore;
                this.adpt      = adpt;
                this.share     = share;
                this.entercode = entercode;

                if (tiletype == (int)TileType.MYEVENTSTITLE)
                {
                    //do nothing -- its the title
                }
                else
                {
                    if (buttons == EventViewType.MYEVENT)
                    {
                        view.Click += (sender, e) =>
                        {
                            if (currentevent != null)
                            {
                                edit(currentevent);
                            }
                        };

                        //view.FindViewById<ImageButton>(Resource.Id.capturebtn).Click += (sender, e) =>
                        //{
                        //    if (currentevent != null)
                        //        capture(currentevent);
                        //};
                        //view.FindViewById<ImageButton>(Resource.Id.editbtn).Click += (sender, e) =>
                        //{
                        //    if (currentevent != null)
                        //        edit(currentevent);
                        //};
                    }
                    else
                    {
                        view.Click += View_Click;
                    }

                    if (view.FindViewById <ImageButton>(Resource.Id.sharebtn) != null)
                    {
                        if (WhiteLabelConfig.EXTERNAL_LINKS)
                        {
                            view.FindViewById <ImageButton>(Resource.Id.sharebtn).Click += ViewHolder_Click;
                        }
                        else
                        {
                            view.FindViewById <ImageButton>(Resource.Id.sharebtn).Visibility = ViewStates.Gone;
                        }
                    }

                    if (view.FindViewById <EditText>(Resource.Id.code) != null)
                    {
                        view.FindViewById <EditText>(Resource.Id.code).TextChanged += ViewHolder_TextChanged;
                    }
                }
            }
        public void UpdateData(List <Shoot> data, EventViewType viewtype)
        {
            ViewType = viewtype;
            allitems = new List <HeaderEventItem>();
            allitems.Clear();

            //if (viewtype == EventViewType.FEATURED && WhiteLabelConfig.ALLOW_CODE_JOIN)
            //    allitems.Add(new HeaderEventItem() { Tiletype = TileType.ENTERCODE });

            if (viewtype == EventViewType.MYEVENT)
            {
                allitems.Add(new HeaderEventItem()
                {
                    Tiletype = TileType.MYEVENTSTITLE
                });
            }


            //if ((context.ApplicationContext as BootleggerApp).Comms.CurrentUser!=null && (viewtype == EventViewType.MYEVENT) && WhiteLabelConfig.ALLOW_CREATE_OWN)
            //    allitems.Add(new HeaderEventItem() { Tiletype = TileType.NEWSHOOT });

            if (data?.Count == 0)
            {
                allitems.Add(new HeaderEventItem()
                {
                    Tiletype = TileType.EMPTY
                });
            }

            if (viewtype == EventViewType.FEATURED)
            {
                data = data.Take(3).ToList();
            }


            if (viewtype == EventViewType.FEATURED)
            {
                if (data != null)
                {
                    foreach (var r in data)
                    {
                        allitems.Add(new HeaderEventItem()
                        {
                            Event = r, Tiletype = TileType.EVENT_FEATURED
                        });
                    }
                }
            }
            else
            {
                if (data != null)
                {
                    foreach (var r in data)
                    {
                        allitems.Add(new HeaderEventItem()
                        {
                            Event = r
                        });
                    }
                }
            }


            Visibleitems = allitems;
            NotifyDataSetChanged();
        }
Exemple #7
0
 public EventPaginationModel(EventViewType eventType, SiteDB dbInstance) : this(eventType, dbInstance, null, null)
 {
 }
Exemple #8
0
        public tbl_Domains SaveDomain(string address, string name, string phone, string consumerKey, string consumerSecret, string css, string defaultDesc, string keywords,
                                      int langID, string title, string desc, string domainName, string email, string googleAnalytics, string googleAnalyticsCode, bool googleAnalyticsVisible,
                                      string robots, string headline, int homePageID, int?launchYear, bool primaryDomain, string share, string twitterSecret, string twitterToken, string twitterUser, bool updateTwitter,
                                      bool isMailChimpEnabled, string mailChimpAPIKey, string mailChimpListID, bool isCommuniGatorEnabled, string communiGatorUser, string communiGatorPassword,
                                      List <tbl_SettingsValue> settingsValues, bool IsPaypalPayment, bool IsSagePayPayment, bool IsSecureTradingPayment, EventViewType eventView, bool enableEventSale,
                                      bool enableProductSale, string theme, bool devMode, int domainID, bool isCoockieConsentEnabled, bool isStripePayment, List <tbl_Social> socialValues, bool customRouteHandler)
        {
            if (String.IsNullOrEmpty(domainName))
            {
                return(null);
            }

            var domain = DomainsRepository.SaveDomain(address, name, phone, consumerKey, consumerSecret,
                                                      css, defaultDesc, keywords, langID, title, desc, domainName, email, googleAnalytics, googleAnalyticsCode,
                                                      googleAnalyticsVisible, robots, headline, homePageID, launchYear, primaryDomain, share, twitterSecret,
                                                      twitterToken, twitterUser, updateTwitter, isMailChimpEnabled, mailChimpAPIKey, mailChimpListID,
                                                      isCommuniGatorEnabled, communiGatorUser, communiGatorPassword, eventView, enableEventSale,
                                                      enableProductSale, theme, devMode, isCoockieConsentEnabled, customRouteHandler, domainID);

            if (domain != null)
            {
                if (domainID == 0)
                {
                    foreach (var value in Enum.GetValues(typeof(SiteMapType)))
                    {
                        SiteMapType type = (SiteMapType)Enum.Parse(typeof(SiteMapType), value.ToString());

                        var sitemap = SitemapRepository.SaveSiteMap(string.Empty, 1, 0, domain.DomainID, String.Empty, false, false, type.ToString(), null,
                                                                    (decimal)0.5, String.Empty, FriendlyUrl.CreateFriendlyUrl(type.ToString()), true, false, ContentType.Content, type.ToString(), 0, 0, (int)type, true);

                        if (sitemap != null)
                        {
                            ContentRepository.SaveContent(String.Empty, String.Empty, type.ToString(), 0, string.Empty, type.ToString(), type.ToString(),
                                                          string.Empty, 0, string.Empty, string.Empty, string.Empty, type.ToString(), string.Empty, false, sitemap.SiteMapID, 0);
                        }
                    }

                    socialValues = this.GetDefaultSocialValues(domain.DomainID);
                }

                PaymentDomainRepository.UpdateStatus(IsPaypalPayment, PaymentType.PayPal, domain.DomainID);
                PaymentDomainRepository.UpdateStatus(IsSagePayPayment, PaymentType.SagePay, domain.DomainID);
                PaymentDomainRepository.UpdateStatus(IsSecureTradingPayment, PaymentType.SecureTrading, domain.DomainID);
                PaymentDomainRepository.UpdateStatus(isStripePayment, PaymentType.Stripe, domain.DomainID);
                SettingsValuesRepository.Save(settingsValues, domain.DomainID);
                SocialRepository.SaveMultipleSocial(socialValues);
                return(domain);
            }

            return(null);
        }