コード例 #1
0
ファイル: PalaverModels.cs プロジェクト: ejwilburn/Palaver
 public Comment(string commentText, User creator)
 {
     CreatedTime     = DateTime.UtcNow;
     LastUpdatedTime = DateTime.UtcNow;
     User            = creator;
     Text            = CustomHtmlHelpers.Linkify(commentText);
 }
コード例 #2
0
    public ActionResult BitsMatchResult(string id)
    {
        Roster roster = CompositionRoot.DocumentSession.Load <Roster>(id);

        ViewBag.Url = CustomHtmlHelpers.GenerateBitsUrl(roster.BitsMatchId);
        return(View());
    }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: ejwilburn/Palaver
        public ActionResult PostReply(int id, string text)
        {
            var comment = db.Comments.First(x => x.CommentId == id);

            // Convert URLs in the text to links if they're not already a link.
            text = CustomHtmlHelpers.Linkify(text);

            Comment newComment = new Comment()
            {
                Text        = text,
                CreatedTime = DateTime.Now
            };

            comment.Comments.Add(newComment);
            db.SaveChanges();

            return(PartialView("_comment", newComment));
        }
コード例 #4
0
        public JsonResult GetList()
        {
            Product[] products = productsData.GetAll().ToArray();

            // Remove html-codes from model description.
            // not using in the current time.
            Product[] productsVM = products.Select(item => new Product()
            {
                Description = CustomHtmlHelpers.RemoveHTMLTags(item.Description),
                Id          = item.Id,
                Image       = item.Image,
                Popular     = item.Popular,
                Price       = item.Price,
                Title       = item.Title
            }
                                                   ).ToArray();

            return(Json(products));
        }
コード例 #5
0
        // Specify menu items to be hidden or shown based on owner type
        private void SetMenuItemControlValues(SiteTopNavModel model)
        {
            // Home
            model.EnableHome = (model.NavigatorType != "Pending" && model.NavigatorType != "Corporate" && model.NavigatorType != "Fixed" && model.NavigatorType != "Flex");
            model.EnableTutorialsAndWebinars = model.NavigatorType != "Sampler";
            model.EnableBluegreenMemories    = TPexpired && model.NavigatorType != "Travelerplus";
            model.EnableOwnerUpdate          = !model.IsTravelerPlusEmployee;
            if (model.IsTravelerPlusEmployee)
            {
                model.HomeURL = "/TravelerPlus/owner/home.aspx";
            }
            if (model.NavigatorType == "Fixed")
            {
                model.HomeURL = "/owner/homefixed.aspx";
            }
            if (model.NavigatorType == "explore")
            {
                model.HomeURL = "/explore/home.aspx";
            }

            // Reservations
            model.EnablePointsReservations     = ((!model.IsTravelerPlusEmployee && model.NavigatorType != "Fixed") || (model.IsPremierOwner && model.NavigatorType != "Fixed"));
            model.EnableBonusTimeReservations  = model.NavigatorType == "owner" || model.NavigatorType == "Travelerplus" || (model.NavigatorType == "Sampler" && model.HomeProject == "52");
            model.EnableCalculatePoints        = model.NavigatorType != "Fixed";
            model.EnableReservationsOurResorts = model.NavigatorType == "Fixed";
            model.EnableTravelServices         = (model.NavigatorType != "Sampler" || (model.NavigatorType == "Sampler" && model.HomeProject == "52"));
            model.EnableResMenuResReminder     = ((model.NavigatorType != "Sampler" && model.NavigatorType != "Fixed" && model.NavigatorType != "Flex") || (model.NavigatorType == "Sampler" && model.HomeProject == "52") || (model.IsPremierOwner && model.NavigatorType != "Fixed"));
            model.EnableChoiceHotels           = model.NavigatorType != "Sampler" || model.IsPremierOwner;
            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // Setting the URL for the Reservations...Travel Services menu item. It is ordered so that the conditions are mutually exclusive and FIFO (in other words, if an account is Sampler and somehow
            // TravelerPlusEmployee (should never happen, but...), the first match takes precedence.
            if (model.NavigatorType == "owner" || model.NavigatorType == "Sampler")
            {
                model.ReservationTravelServicesURL = "/owner/TravelServices.aspx";
            }
            else if (model.IsTravelerPlusEmployee)
            {
                if (model.IsTPExpired)
                {
                    model.ReservationTravelServicesURL = "/TravelerPlus/owner/TravelServices.aspx";
                }
            }
            else if (model.IsPremierOwner || model.NavigatorType == "Travelerplus" || model.NavigatorType == "Fixed")
            {
                model.ReservationTravelServicesURL = "/owner/TravelServices.aspx";
            }
            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            // My Account
            model.EnableMyAccount = true;
            model.EnableGoGreen   = (!model.IsTravelerPlusEmployee && model.NavigatorType != "Sampler");
            model.EnableMyAccountBluegreenPremier = (!(model.NavigatorType == "Sampler" || model.NavigatorType == "Fixed") && model.ShowGuestProfile != "V");
            model.EnableFreeStayCertificate       = model.ShowGuestProfile == "P" || model.ShowGuestProfile == "G";
            model.EnableChoicePrivileges          = (model.NavigatorType == "owner" || model.NavigatorType == "Sampler" || model.IsPremierOwner || model.NavigatorType == "Travelerplus") && model.ContractType != "Sampler";
            model.EnableMyPoints = (model.NavigatorType != "Fixed" && model.NavigatorType != "Flex" && !model.IsTravelerPlusEmployee);
            model.MyPointsURL    = (Session["IsFixedFlexOrTraditionalOwner"] is bool && (bool)Session["IsFixedFlexOrTraditionalOwner"]) ? "/owner/ownerAccount.aspx" : CustomHtmlHelpers.GetFullSitePath(null) + "/my-points";

            // Payments
            model.EnablePayments            = true;
            model.EnablePrePayment          = (!model.IsTravelerPlusEmployee && !InstalPayEligible);
            model.EnableViewInstallmentPlan = InstalPayEligible;
            model.EnableChangeInstallPlanCC = InstalPayEligible && (InstallStatus == "IP");

            // Traveler Plus
            model.EnableTravelerPlus      = ((model.NavigatorType == "Travelerplus" || model.IsPremierOwner) && !TPexpired);
            model.TravelerPlusLevel       = TrvelerPlusLevel;
            model.EnableRenewTravelerPlus = model.TPRenewLink;
            /////////////////////////////////////////////////////////////////////////////
            // Setting the URL for when owner clicks on top level Traveler Plus menu item
            if (model.NavigatorType == "owner" || model.NavigatorType == "Sampler" || model.NavigatorType == "Fixed")
            {
                model.TravelerPlusURL = "/owner/vcTravelerPlus.aspx";
            }
            else if (model.IsTravelerPlusEmployee)
            {
                model.TravelerPlusURL = "/TravelerPlus/owner/home.aspx";
            }
            else if (model.IsPremierOwner || model.NavigatorType == "Travelerplus")
            {
                if (bxgOwner.User[0].AllAccountsComesFromSecondaryMarketing && TPexpired)
                {
                    model.TravelerPlusURL = "/owner/vcTravelerPlus.aspx";
                }
                else
                {
                    model.TravelerPlusURL = "/TravelerPlus/owner/home.aspx";
                }
            }
            /////////////////////////////////////////////////////////////////////////////

            // Bluegreen Rewards
            model.EnableBluegreenRewards    = (!model.IsTravelerPlusEmployee && model.NavigatorType != "Sampler");
            model.EnableRegisterFriends     = (model.NavigatorType == "Travelerplus" && tpnav) || model.NavigatorType == "Fixed" || model.NavigatorType == "Pending";
            model.EnableSendOffersToFriends = (model.NavigatorType == "Travelerplus" && tpnav) || model.NavigatorType == "Fixed" || model.NavigatorType == "Pending";
            model.EnableReferralParties     = (model.NavigatorType == "Travelerplus" && !tpnav);

            // Using the Club
            model.EnableVacationClub          = model.ContractType.ToUpper() != "TRADITIONAL" && model.NavigatorType != "Sampler";
            model.EnableVacationClubFixedMenu = (model.NavigatorType == "Fixed");
            model.EnableBluegreenPremier      = model.ShowGuestProfile == "V" && model.NavigatorType != "Sampler" && model.NavigatorType != "Fixed" && model.ContractType.ToUpper() != "TRADITIONAL" && !model.IsTravelerPlusEmployee;

            if (model.ContractType == "Vacation Club")
            {
                model.UsingTheClubURL = ConfigurationManager.AppSettings["UsingTheClub_VCOwner"];
            }
            else if (model.NavigatorType == "Sampler")
            {
                if (model.HomeProject == "52")
                {
                    model.UsingTheClubURL = ConfigurationManager.AppSettings["UsingTheClub_Sampler24"];
                }
                else
                {
                    model.UsingTheClubURL = ConfigurationManager.AppSettings["UsingTheClub_Sampler"];
                }
            }
            if (model.UsingTheClubURL.IndexOf("~") == 0)
            {
                model.UsingTheClubURL = model.UsingTheClubURL.Substring(1);
            }

            if (model.EnableBluegreenPremier)
            {
                model.TutorialsAndWebinars = ConfigurationManager.AppSettings["TutorialsAndWebinars"];
            }
            else
            {
                model.TutorialsAndWebinars = ConfigurationManager.AppSettings["TutorialsAndWebinarsUTC"];;
            }
            if (model.TutorialsAndWebinars.IndexOf("~") == 0)
            {
                model.TutorialsAndWebinars = model.TutorialsAndWebinars.Substring(1);
            }

            if (model.EnableVacationClubFixedMenu)
            {
                model.BluegreenVacationClub = "/owner/vacationclub.aspx";
                model.HowItWorks            = "/owner/vcHowItWorks.aspx";
                model.OwnerTestimonials     = "/owner/vcTestimonials.aspx";
                model.OurResorts            = "/BGModern/our-resorts";
                model.TellMeMore            = "/owner/learnMore.aspx";
                model.HelpFAQs  = "/owner/faq.aspx";
                model.ContactUs = "/owner/contact.aspx";
            }

            //if (model.NavigatorType == "Sampler")
            //{
            //    if (model.HomeProject == "51")
            //    {
            //        model.TravelerPlusURL = "/owner/clubuse-valuesampler.aspx";
            //    }
            //    else if (model.HomeProject == "52")
            //    {
            //        model.TravelerPlusURL = "/owner/clubuse-sampler24.aspx";
            //    }
            //}
        }