コード例 #1
0
        public JsonResult DuoPricing(PurchaseForm Model)
        {
            decimal         price;
            string          requiredDivision = Model.BoostingModel.DesiredCurrentLeague == "Master" ? Model.BoostingModel.DesiredCurrentLeague : $"{Model.BoostingModel.DesiredCurrentLeague} {Model.BoostingModel.DesiredCurrentDivision}";
            DuoBoostPricing result           = ObjectFactory.DuoBoostPricing.Where(x => x.CurrentDivision == $"{Model.BoostingModel.YourCurrentLeague} {Model.BoostingModel.CurrentDivision}" && x.CurrentLP == Model.BoostingModel.CurrentLP.Replace("LP ", "") &&
                                                                                   x.RequiredDivision == requiredDivision).FirstOrDefault();

            if (result == null)
            {
                return(Json(0));
            }
            else
            {
                if (Model.BoostingModel.TypeOfDuoPremium != "false")
                {
                    price = decimal.Parse(result.OurPremiumPrice);
                }
                else
                {
                    price = decimal.Parse(result.OurRegularPrice);
                }


                price = LolPricingExtensions.PriceIncreaseLolNA(Model.BoostingModel.Server, price, 60);
                var priceDiscountResult = LolDiscountExtensions.PriceDiscount(Model.BoostingModel.DiscountCode, price);
                price = (System.Math.Ceiling(priceDiscountResult.Price * 100) / 100);
                return(Json(new { success = true, Price = price, Discount = priceDiscountResult.DicountPercentage, DiscountModel = priceDiscountResult.Discount }));
            }
        }
コード例 #2
0
        public JsonResult WinBoostPricing(PurchaseForm Model)
        {
            decimal price;
            string  premiumOrRegular = Model.WinBoostModel.TypeOfDuoPremium != "false" ? "Premium" : "Regular";
            string  lastSeason       = Model.WinBoostModel.TypeOfService == "Duo" ? $"{Model.WinBoostModel.YourCurrentLeague} {Model.WinBoostModel.CurrentDivision} ({Model.WinBoostModel.TypeOfService}) ({premiumOrRegular})"
                        : $"{Model.WinBoostModel.YourCurrentLeague} {Model.WinBoostModel.CurrentDivision} ({Model.WinBoostModel.TypeOfService})";

            if (Model.WinBoostModel.YourCurrentLeague == "Master" || Model.WinBoostModel.YourCurrentLeague == "Grandmaster" || Model.WinBoostModel.YourCurrentLeague == "Challenger")
            {
                lastSeason = Model.WinBoostModel.TypeOfService == "Duo" ? $"{Model.WinBoostModel.YourCurrentLeague} ({Model.WinBoostModel.TypeOfService}) ({premiumOrRegular})"
                                : $"{Model.WinBoostModel.YourCurrentLeague} ({Model.WinBoostModel.TypeOfService})";
            }

            WinBoostPricing result = ObjectFactory.WinBoostPricing.Where(x => x.LastSeasonStanding == lastSeason && x.NumberOfGames == Model.WinBoostModel.NumOfGames).FirstOrDefault();

            if (result == null)
            {
                return(Json(1.50));
            }
            else
            {
                price = (System.Math.Ceiling(decimal.Parse(result.OurPrice) * 100) / 100);

                price = LolPricingExtensions.PriceIncreaseLolNA(Model.WinBoostModel.Server, price, 40);
                var priceDiscountResult = LolDiscountExtensions.PriceDiscount(Model.WinBoostModel.Discount, price);
                price = priceDiscountResult.Price;
                return(Json(new { success = true, Price = price, Discount = priceDiscountResult.DicountPercentage, DiscountModel = priceDiscountResult.Discount }));
            }
        }
コード例 #3
0
        public JsonResult SoloPricing(PurchaseForm Model)
        {
            string           requiredDivision = Model.BoostingModel.DesiredCurrentLeague == "Master" ? Model.BoostingModel.DesiredCurrentLeague : $"{Model.BoostingModel.DesiredCurrentLeague} {Model.BoostingModel.DesiredCurrentDivision}";
            SoloBoostPricing result           = ObjectFactory.SoloBoostPricing.Where(x => x.CurrentDivision == $"{Model.BoostingModel.YourCurrentLeague} {Model.BoostingModel.CurrentDivision}" && x.CurrentLP == Model.BoostingModel.CurrentLP.Replace("LP ", "") &&
                                                                                     x.RequiredDivision == requiredDivision).FirstOrDefault();

            if (result == null)
            {
                return(Json(0));
            }
            else
            {
                decimal price = decimal.Parse(result.OurPrice);
                if (Model.BoostingModel.SpecificRolesADC != "false" || Model.BoostingModel.SpecificRolesTop != "false" || Model.BoostingModel.SpecificRolesJungle != "false" || Model.BoostingModel.SpecificRolesMiddle != "false" || Model.BoostingModel.SpecificRolesSupport != "false")
                {
                    // Add 15%
                    price = price + (price / 100) * 15;
                }
                if (Model.BoostingModel.SpecificChampions != null)
                {
                    price = price + (price / 100) * 15;
                }


                price = LolPricingExtensions.PriceIncreaseLolNA(Model.BoostingModel.Server, price, 20);
                var priceDiscountResult = LolDiscountExtensions.PriceDiscount(Model.BoostingModel.DiscountCode, price);
                price = (System.Math.Ceiling(priceDiscountResult.Price * 100) / 100);
                return(Json(new { success = true, Price = price, Discount = priceDiscountResult.DicountPercentage, DiscountModel = priceDiscountResult.Discount }));
            }
        }
コード例 #4
0
        public IActionResult CompleteBoosterJobSuperUser(int Id)
        {
            var result = PurchaseOrderRepository.GetPurchaseFormModelsIncludedById(Id);

            result.AdminCompletionConfirmed  = true;
            result.BoosterAssignedTo.Balance = result.BoosterAssignedTo.Balance + (decimal)LolPricingExtensions.BoosterPay(result);
            PurchaseOrderRepository.Update(result);
            return(Json(true));
        }
コード例 #5
0
ファイル: DiscordBot.cs プロジェクト: sapsal/SpartanBoosting
        public string DiscordMessage(Models.Pricing.PurchaseForm Model)
        {
            switch (Model.PurchaseType)
            {
            case PurchaseTypeEnum.PurchaseType.SoloBoosting:
                return(DiscordServerTagMessage(Model.BoostingModel.Server) + "**New Division Solo**\n" +
                       $"**Job Number : {Model.Id}**\n" +
                       $"**Job : { Model.BoostingModel.YourCurrentLeague}{ Model.BoostingModel.CurrentDivision} { Model.BoostingModel.CurrentLP} to { Model.BoostingModel.DesiredCurrentLeague} { Model.BoostingModel.DesiredCurrentDivision}**\n" +
                       $"**Server : {Model.BoostingModel.Server}**\n" +
                       $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");

            case PurchaseTypeEnum.PurchaseType.DuoBoosting:
                return(DiscordServerTagMessage(Model.BoostingModel.Server) + "**New Division Duo**\n" +
                       $"**Job Number : {Model.Id}**\n" +
                       $"**Job : { Model.BoostingModel.YourCurrentLeague}{ Model.BoostingModel.CurrentDivision} { Model.BoostingModel.CurrentLP} to { Model.BoostingModel.DesiredCurrentLeague} { Model.BoostingModel.DesiredCurrentDivision}**\n" +
                       $"**Server : {Model.BoostingModel.Server}**\n" +
                       $"**Type : {(Model.BoostingModel.TypeOfDuoRegular != "false" ? Model.BoostingModel.TypeOfDuoRegular : Model.BoostingModel.TypeOfDuoPremium)}**\n" +
                       $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");

            case PurchaseTypeEnum.PurchaseType.WinBoosting:
                if (Model.WinBoostModel.TypeOfService == "Duo")
                {
                    return(DiscordServerTagMessage(Model.WinBoostModel.Server) + "**Win Boosting**\n" +
                           $"**Job Number : {Model.Id}**\n" +
                           $"**Job : {Model.WinBoostModel.YourCurrentLeague} {Model.WinBoostModel.CurrentDivision} with {Model.WinBoostModel.NumOfGames} games**\n" +
                           $"**Server : {Model.WinBoostModel.Server}**\n" +
                           $"**Type : Duo {(Model.WinBoostModel.TypeOfDuoRegular != "false" ? Model.WinBoostModel.TypeOfDuoRegular : Model.WinBoostModel.TypeOfDuoPremium)}**\n" +
                           $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");
                }
                else
                {
                    return(DiscordServerTagMessage(Model.WinBoostModel.Server) + "**Win Boosting**\n" +
                           $"**Job Number : {Model.Id}**\n" +
                           $"**Job : {Model.WinBoostModel.YourCurrentLeague} {Model.WinBoostModel.CurrentDivision} with {Model.WinBoostModel.NumOfGames} games**\n" +
                           $"**Server : {Model.WinBoostModel.Server}**\n" +
                           $"**Type : Solo**\n" +
                           $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");
                }

            case PurchaseTypeEnum.PurchaseType.PlacementMatches:
                if (Model.PlacementMatchesModel.TypeOfService == "Duo")
                {
                    return(DiscordServerTagMessage(Model.PlacementMatchesModel.Server) + "**Placement Matches**\n" +
                           $"**Job Number : {Model.Id}**\n" +
                           $"**Job : {Model.PlacementMatchesModel.LastSeasonStanding} with {Model.PlacementMatchesModel.NumOfGames} games**\n" +
                           $"**Server : {Model.PlacementMatchesModel.Server}**\n" +
                           $"**Type : Duo {(Model.PlacementMatchesModel.TypeOfDuoRegular != "false" ? Model.PlacementMatchesModel.TypeOfDuoRegular : Model.PlacementMatchesModel.TypeOfDuoPremium)}**\n" +
                           $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");
                }
                else
                {
                    return(DiscordServerTagMessage(Model.PlacementMatchesModel.Server) + $"**Placement Matches {Model.PlacementMatchesModel.TypeOfService}**\n" +
                           $"**Job : {Model.PlacementMatchesModel.LastSeasonStanding} with {Model.PlacementMatchesModel.NumOfGames} games**\n" +
                           $"**Server : {Model.PlacementMatchesModel.Server}**\n" +
                           $"**Type : Solo**\n" +
                           $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");
                }

            case PurchaseTypeEnum.PurchaseType.TFTPlacement:
                return(DiscordServerTagMessage(Model.TFTPlacementModel.Server) + "**TFT Placement**\n" +
                       $"**Job : {Model.TFTPlacementModel.LastSeasonStanding} with {Model.TFTPlacementModel.NumberOfGames} games**\n" +
                       $"**Server : {Model.TFTPlacementModel.Server}**\n" +
                       $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");

            case PurchaseTypeEnum.PurchaseType.TFTBoosting:
                return(DiscordServerTagMessage(Model.TFTBoostingModel.Server) + "**TFT Solo Boosting**\n" +
                       $"**Job : {Model.TFTBoostingModel.YourCurrentLeague} {Model.TFTBoostingModel.CurrentDivision} {Model.TFTBoostingModel.CurrentLP} to {Model.TFTBoostingModel.DesiredCurrentLeague} {Model.TFTBoostingModel.DesiredCurrentDivision}**\n" +
                       $"**Server : {Model.TFTBoostingModel.Server}**\n" +
                       $"**Price : €{LolPricingExtensions.BoosterPay(Model)}**");

            case PurchaseTypeEnum.PurchaseType.Coaching:
                break;

            default:
                break;
            }
            return("");
        }