Ejemplo n.º 1
0
        protected override ShoppingCartRuleResult PerformRules(ShoppingCart_V02 cart, ShoppingCartRuleReason reason,
                                                               ShoppingCartRuleResult Result)
        {
            if (reason == ShoppingCartRuleReason.CartItemsBeingAdded)
            {
                var myhlCart = cart as MyHLShoppingCart;

                if (null == myhlCart)
                {
                    LoggerHelper.Error(
                        string.Format("{0} myhlCart is null {1}", Locale, cart.DistributorID));
                    Result.Result = RulesResult.Failure;
                    return(Result);
                }
                // to set purchasing limit type
                var theLimits     = GetPurchasingLimits(cart.DistributorID, myhlCart.SelectedDSSubType ?? string.Empty);
                var currentLimits = theLimits[PurchasingLimitProvider.GetOrderMonth()];
                if (currentLimits.PurchaseLimitType == PurchaseLimitType.Earnings)
                {
                    var itemsToCalc = new List <ShoppingCartItem_V01>();
                    itemsToCalc.AddRange(myhlCart.CartItems);
                    if (myhlCart.CurrentItems != null && myhlCart.CurrentItems.Count > 0)
                    {
                        itemsToCalc.Add(myhlCart.CurrentItems[0]);
                    }
                    OrderTotals_V01 orderTotals = myhlCart.Calculate(itemsToCalc) as OrderTotals_V01;
                    if (orderTotals != null && orderTotals.DiscountPercentage != 0.0M)
                    {
                        myhlCart.SetDiscountForLimits(orderTotals.DiscountPercentage);
                        myhlCart.Totals = orderTotals;
                    }
                }
            }
            return(base.PerformRules(cart, reason, Result));
        }
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            var currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
            var limitsType    = PurchaseLimitType.ProductCategory;

            var codes = new List <string>(CountryType.VN.HmsCountryCodes);

            codes.Add(CountryType.VN.Key);

            if (codes.Contains(DistributorProfileModel.ProcessingCountryCode))
            {
                var hasValidTin = HasValidTin(distributorId);
                //var hasMandatoryNotes = HasMandatoryNotes(distributorId);

                //if (hasValidTin && !hasMandatoryNotes && DistributorProfileModel.TypeCode.ToUpper().Equals("DS"))
                if (hasValidTin && DistributorProfileModel.TypeCode.ToUpper().Equals("DS"))
                {
                    limitsType = PurchaseLimitType.Volume;
                    theLimits.RemainingVolume = MaxVolPoints;
                }
            }
            currentLimits.Values.AsQueryable().ToList().ForEach(pl => pl.PurchaseLimitType = limitsType);
            return(currentLimits);
        }
Ejemplo n.º 3
0
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            Dictionary <int, PurchasingLimits_V01> currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            PurchasingLimits_V01 theLimits  = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
            PurchaseLimitType    limitsType = PurchaseLimitType.ProductCategory;

            var  tins     = DistributorOrderingProfileProvider.GetTinList(distributorId, true);
            bool bHasMYID = tins.Find(t => t.IDType.Key == "MYID") != null;

            if (!DistributorIsExemptFromPurchasingLimits(distributorId))
            {
                limitsType = PurchaseLimitType.Volume;
                if (!bHasMYID)
                {
                    limitsType = PurchaseLimitType.ProductCategory;
                }
            }
            else
            {
                if (bHasMYID)
                {
                    limitsType = PurchaseLimitType.None;
                }
            }
            currentLimits.Values.AsQueryable().ToList().ForEach(pl => pl.PurchaseLimitType = limitsType);

            return(currentLimits);
        }
        private DateTime GetLastQuarterlyCutoff()
        {
            int currentOrderMonth = PurchasingLimitProvider.GetOrderMonth();
            var lastCutoff        = DateTime.MinValue;
            int month             = int.Parse(currentOrderMonth.ToString().Substring(4));
            int year = int.Parse(currentOrderMonth.ToString().Substring(0, 4));

            switch (month)
            {
            case 1:
            case 2:
            case 3:
            {
                lastCutoff = new DateTime(year - 1, 12, 31, 23, 59, 59);
                break;
            }

            case 4:
            case 5:
            case 6:
            {
                lastCutoff = new DateTime(year, 3, 31, 23, 59, 59);
                break;
            }

            case 7:
            case 8:
            case 9:
            {
                lastCutoff = new DateTime(year, 6, 30, 23, 59, 59);
                break;
            }

            case 10:
            case 11:
            case 12:
            {
                lastCutoff = new DateTime(year, 9, 30, 23, 59, 59);
                break;
            }
            }

            return(lastCutoff);
        }
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            Dictionary <int, PurchasingLimits_V01> currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            PurchasingLimits_V01 theLimits  = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
            PurchaseLimitType    limitsType = PurchaseLimitType.ProductCategory;
            var tins = DistributorOrderingProfileProvider.GetTinList(distributorId, true);

            List <string> codes = new List <string>(CountryType.SG.HmsCountryCodes);

            codes.Add(CountryType.SG.Key);

            if (tins != null)
            {
                TaxIdentification tid = null;
                if ((tid = tins.Find(t => t.IDType.Key == "SNID")) != null)
                {
                    limitsType = PurchaseLimitType.None;
                }
                else
                {
                    // no SNID
                    if (codes.Contains(DistributorProfileModel.ProcessingCountryCode))
                    {
                        limitsType = PurchaseLimitType.None;
                    }
                }
            }

            // DS with Dummy TIN No "S0000000S", can purchase any category of products up to 1100 vp per order
            if (tins != null && tins.Find(t => t.ID == "S0000000S") != null)
            {
                limitsType = PurchaseLimitType.Volume;
                theLimits.RemainingVolume = MaxVolPoints;
            }

            if (PurchasingLimitProvider.IsRestrictedByMarketingPlan(distributorId))
            {
                limitsType = PurchaseLimitType.Volume;
            }
            currentLimits.Values.AsQueryable().ToList().ForEach(pl => pl.PurchaseLimitType = limitsType);

            return(currentLimits);
        }
Ejemplo n.º 6
0
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            var currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];

            if (TIN.Equals("ETO"))
            {
                TIN = "E";
            }

            theLimits.PurchaseSubType = TIN;

            if (RetailSubTypes.Contains(theLimits.PurchaseSubType))
            {
                theLimits.PurchaseType      = OrderPurchaseType.PersonalConsumption;
                theLimits.PurchaseLimitType = PurchaseLimitType.DiscountedRetail;
            }
            else if (ResaleSubTypes.Contains(theLimits.PurchaseSubType))
            {
                theLimits.PurchaseType      = OrderPurchaseType.Consignment;
                theLimits.PurchaseLimitType = PurchaseLimitType.None;
            }
            else
            {
                if (PurchasingLimitManager(distributorId).PurchasingLimitsRestriction !=
                    PurchasingLimitRestrictionType.MarketingPlan)
                {
                    theLimits.PurchaseLimitType = PurchaseLimitType.None;

                    if (!ExemptSubTypes.Contains(theLimits.PurchaseSubType))
                    {
                        LoggerHelper.Error(
                            string.Format(
                                "Unknown Distributor Subtype of \"{0}\" encountered in PurchasingLimitRules for fr-FR, Distributor: {1}",
                                theLimits.PurchaseSubType, distributorId));
                    }
                }
            }

            return(currentLimits);
        }
Ejemplo n.º 7
0
        protected override ShoppingCartRuleResult PerformRules(ShoppingCart_V02 cart, ShoppingCartRuleReason reason,
                                                               ShoppingCartRuleResult Result)
        {
            if (reason == ShoppingCartRuleReason.CartItemsBeingAdded)
            {
                var currentLimits = base.GetPurchasingLimits(cart.DistributorID, string.Empty);
                var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
                // If it's threshold volume point for all product types is counted
                if (PurchasingLimitProvider.IsOrderThresholdMaxVolume(theLimits))
                {
                    Result = base.PerformRules(cart, reason, Result);
                }
                else if (!DistributorIsExemptFromPurchasingLimits(cart.DistributorID))
                {
                    CatalogItem_V01 currentItem = CatalogProvider.GetCatalogItem(cart.CurrentItems[0].SKU, Country);
                    Result = base.PerformRules(cart, reason, Result);
                }
            }

            return(Result);
        }
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            Dictionary <int, PurchasingLimits_V01> currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            PurchasingLimits_V01 theLimits = currentLimits[PurchasingLimitProvider.GetOrderMonth()];

            theLimits.PurchaseSubType = TIN;

            if (PurchasingLimitProvider.IsRestrictedByMarketingPlan(distributorId))
            {
                theLimits.PurchaseLimitType = PurchaseLimitType.Volume;
                return(currentLimits);
            }
            if (DistributorIsExemptFromPurchasingLimits(distributorId))
            {
                theLimits.PurchaseLimitType = PurchaseLimitType.None;
            }
            else
            {
                theLimits.PurchaseType      = OrderPurchaseType.PersonalConsumption;
                theLimits.PurchaseLimitType = PurchaseLimitType.TotalPaid;
            }

            return(currentLimits);
        }
Ejemplo n.º 9
0
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            var currentLimits = base.GetPurchasingLimits(distributorId, TIN);
            var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];

            //conditional massage of subtype
            if (TIN.Equals("D") || TIN.Equals("ETO"))
            {
                TIN = "D2";
            }

            theLimits.PurchaseSubType = TIN;

            if (RetailSubTypes.Contains(theLimits.PurchaseSubType))
            {
                theLimits.PurchaseType      = OrderPurchaseType.PersonalConsumption;
                theLimits.PurchaseLimitType = PurchaseLimitType.Volume;
            }
            else if (ResaleSubTypes.Contains(theLimits.PurchaseSubType))
            {
                theLimits.PurchaseType      = OrderPurchaseType.Consignment;
                theLimits.PurchaseLimitType = PurchaseLimitType.Earnings;
            }
            else
            {
                if (!ExemptSubTypes.Contains(theLimits.PurchaseSubType))
                {
                    LoggerHelper.Error(
                        string.Format(
                            "Unknown Distributor Subtype of \"{0}\" encountered in PurchasingLimitRules for it-IT, Distributor: {1}",
                            theLimits.PurchaseSubType, distributorId));
                }
            }

            return(currentLimits);
        }
 public virtual int GetOrderMonth()
 {
     return(PurchasingLimitProvider.GetOrderMonth());
 }
Ejemplo n.º 11
0
        protected override ShoppingCartRuleResult PerformRules(ShoppingCart_V02 cart, ShoppingCartRuleReason reason,
                                                               ShoppingCartRuleResult Result)
        {
            if (reason == ShoppingCartRuleReason.CartItemsBeingAdded)
            {
                var currentLimits = base.GetPurchasingLimits(cart.DistributorID, string.Empty);
                var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
                // If it's threshold volume point for all product types is counted
                if (PurchasingLimitProvider.IsOrderThresholdMaxVolume(theLimits))
                {
                    Result = base.PerformRules(cart, reason, Result);
                }
                else if (!DistributorIsExemptFromPurchasingLimits(cart.DistributorID))
                {
                    CatalogItem_V01 currentItem = CatalogProvider.GetCatalogItem(cart.CurrentItems[0].SKU, Country);
                    Result = base.PerformRules(cart, reason, Result);
                }
            }

            if (reason == ShoppingCartRuleReason.CartCreated && cart.CartItems.Any())
            {
                var currentLimits = base.GetPurchasingLimits(cart.DistributorID, string.Empty);
                var theLimits     = currentLimits[PurchasingLimitProvider.GetOrderMonth()];
                // If it's threshold volume point for all product types is counted
                if (PurchasingLimitProvider.IsOrderThresholdMaxVolume(theLimits))
                {
                    Result = base.PerformRules(cart, reason, Result);
                }
                else if (!DistributorIsExemptFromPurchasingLimits(cart.DistributorID))
                {
                    var     purchasingLimitManager               = PurchasingLimitManager(cart.DistributorID);
                    decimal DistributorRemainingVolumePoints     = 0;
                    decimal DistributorRemainingDiscountedRetail = 0;
                    var     myhlCart = cart as MyHLShoppingCart;
                    if (null == myhlCart)
                    {
                        LoggerHelper.Error(
                            string.Format("{0} myhlCart is null {1}", Locale, cart.DistributorID));
                        Result.Result = RulesResult.Failure;
                        return(Result);
                    }

                    PurchasingLimits_V01 PurchasingLimits =
                        PurchasingLimitProvider.GetCurrentPurchasingLimits(cart.DistributorID);

                    purchasingLimitManager.SetPurchasingLimits(PurchasingLimits);

                    if (null == PurchasingLimits)
                    {
                        LoggerHelper.Error(
                            string.Format("{0} PurchasingLimits could not be retrieved for distributor {1}", Locale,
                                          cart.DistributorID));
                        Result.Result = RulesResult.Failure;
                        return(Result);
                    }

                    DistributorRemainingVolumePoints         =
                        DistributorRemainingDiscountedRetail = PurchasingLimits.RemainingVolume;

                    if (PurchasingLimits.PurchaseLimitType == PurchaseLimitType.Volume)
                    {
                        if (PurchasingLimits.maxVolumeLimit == -1)
                        {
                            return(Result);
                        }
                        decimal cartVolume = (cart as MyHLShoppingCart).VolumeInCart;
                        if (DistributorRemainingVolumePoints - cartVolume < 0)
                        {
                            Result.Result = RulesResult.Failure;
                            Result.AddMessage(
                                PlatformResources.GetGlobalResourceString("ErrorMessage",
                                                                          "NoCheckoutPurchaseLimitsExceeded"));
                            cart.RuleResults.Add(Result);
                        }
                    }
                    else
                    {
                        Result.Result = RulesResult.Success;
                    }
                }
                else
                {
                    Result = base.PerformRules(cart, reason, Result);
                }
            }
            return(Result);
        }
        public override Dictionary <int, PurchasingLimits_V01> GetPurchasingLimits(string distributorId, string TIN)
        {
            if (DistributorIsExemptFromPurchasingLimits(distributorId))
            {
                return(null);
            }

            //Fetch these records from Web Service
            string country = DistributorProfileModel.ProcessingCountryCode;

            var purchasingLimitManager = PurchasingLimitManager(distributorId);

            purchasingLimitManager.SetPurchasingLimits(PurchasingLimitProvider.GetOrderMonth());
            PurchasingLimits_V01 currentLimits = PurchasingLimitProvider.GetCurrentPurchasingLimits(distributorId);
            //Get the current Limits if the exist
            PurchasingLimits_V01 storedLimits = PurchasingLimitProvider.GetPurchasingLimitsFromStore(Country,
                                                                                                     distributorId);
            //Get the saved limits for the DS and country

            PurchasingLimits_V01 theLimits = null;

            if (null != storedLimits && storedLimits.Id > 0) //Decide if we use the stored limits
            {
                storedLimits.MaxEarningsLimit = purchasingLimitManager.MaxEarningsLimit;
                storedLimits.maxVolumeLimit   = purchasingLimitManager.MaxPersonalConsumptionLimit;

                if (IsBlackoutPeriod() || storedLimits.OutstandingOrders > 0 ||
                    PurchasingLimitProvider.GetDistributorPurchasingLimitsSource(Country, distributorId) ==
                    DistributorPurchasingLimitsSourceType.InternetOrdering)
                {
                    theLimits = storedLimits;
                    PurchasingLimitProvider.UpdatePurchasingLimits(theLimits, distributorId);
                }
                else
                {
                    theLimits = currentLimits;
                }
            }
            else
            {
                theLimits = currentLimits;
            }

            if (null == theLimits) //We're bare and need the DS
            {
                theLimits = new PurchasingLimits_V01();
                var limit = purchasingLimitManager.ReloadPurchasingLimits(PurchasingLimitProvider.GetOrderMonth());
                if (null != currentLimits) //if We're already init'ed resolve against current refreshed DS
                {
                    if (currentLimits.RemainingVolume > purchasingLimitManager.RemainingPersonalConsumptionLimit)
                    {
                        currentLimits.RemainingVolume = purchasingLimitManager.RemainingPersonalConsumptionLimit;
                    }
                    if (currentLimits.RemainingEarnings > purchasingLimitManager.RemainingEarningsLimit)
                    {
                        currentLimits.RemainingEarnings = purchasingLimitManager.RemainingEarningsLimit;
                    }
                    currentLimits.MaxEarningsLimit = purchasingLimitManager.MaxEarningsLimit;
                    currentLimits.maxVolumeLimit   = purchasingLimitManager.MaxPersonalConsumptionLimit;
                    theLimits          = currentLimits;
                    theLimits.LastRead = DateTime.UtcNow;
                }
                else
                {
                    //Probably first time in - refresh from DS.
                    theLimits.RemainingVolume   = purchasingLimitManager.RemainingPersonalConsumptionLimit;
                    theLimits.RemainingEarnings = purchasingLimitManager.RemainingEarningsLimit;
                    theLimits.MaxEarningsLimit  = purchasingLimitManager.MaxEarningsLimit;
                    theLimits.maxVolumeLimit    = purchasingLimitManager.MaxPersonalConsumptionLimit;
                    theLimits.LastRead          = DateTime.UtcNow;
                }
            }

            if (null == storedLimits)
            {
                PurchasingLimitProvider.UpdatePurchasingLimits(theLimits, distributorId, country, true);
            }
            else
            {
                PurchasingLimitProvider.UpdatePurchasingLimits(theLimits, distributorId, PurchasingLimitProvider.GetOrderMonth());
            }
            var theCurrentLimits = PurchasingLimitProvider.GetCurrentPurchasingLimits(distributorId);
            var limitsType       = PurchaseLimitType.Volume;

            if (theCurrentLimits.maxVolumeLimit < 0)
            {
                limitsType = PurchaseLimitType.None;
            }

            purchasingLimitManager.PurchasingLimits.Values.AsQueryable().ToList().ForEach(pl => pl.PurchaseLimitType = limitsType);

            return(purchasingLimitManager.PurchasingLimits);
        }
Ejemplo n.º 13
0
        /// <summary>
        ///     The IShoppingCart Rule Interface implementation
        /// </summary>
        /// <param name="cart">The current Shopping Cart</param>
        /// <param name="reason">The Rule invoke Reason</param>
        /// <param name="Result">The Rule Results collection</param>
        /// <returns>The cumulative rule results - including the results of this iteration</returns>
        protected override ShoppingCartRuleResult PerformRules(ShoppingCart_V02 cart,
                                                               ShoppingCartRuleReason reason,
                                                               ShoppingCartRuleResult Result)
        {
            if (reason == ShoppingCartRuleReason.CartItemsBeingAdded)
            {
                decimal DistributorRemainingVolumePoints = 0;
                decimal NewVolumePoints = 0;

                if (cart.CurrentItems == null || cart.CurrentItems.Count == 0)
                {
                    Result.Result = RulesResult.Failure;
                    return(Result);
                }

                var orderMonth = new OrderMonth(Country);

                PurchasingLimitManager(cart.DistributorID).SetPurchasingLimits(PurchasingLimitProvider.GetOrderMonth());

                var PurchasingLimits =
                    PurchasingLimitProvider.GetCurrentPurchasingLimits(cart.DistributorID);

                if (null == PurchasingLimits)
                {
                    LoggerHelper.Error(
                        string.Format("{0} PurchasingLimits could not be retrieved for distributor {1}", Locale,
                                      cart.DistributorID));
                    Result.Result = RulesResult.Failure;
                    return(Result);
                }

                DistributorRemainingVolumePoints = PurchasingLimits.RemainingVolume;
                var currentItem = CatalogProvider.GetCatalogItem(cart.CurrentItems[0].SKU, Country);
                if (currentItem != null)
                {
                    if (currentItem.ProductType == ServiceProvider.CatalogSvc.ProductType.EventTicket)
                    {
                        PurchasingLimitProvider.GetPurchasingLimits(cart.DistributorID, "ETO");
                    }
                    else
                    {
                        NewVolumePoints = currentItem.VolumePoints * cart.CurrentItems[0].Quantity;
                    }
                }

                // validate order threshold first
                if (PurchasingLimits.maxVolumeLimit == -1)
                {
                    return(Result);
                }

                if (PurchasingLimits.PurchaseLimitType == PurchaseLimitType.ProductCategory && currentItem.ProductType == ServiceProvider.CatalogSvc.ProductType.Product)
                {
                    Result.Result = RulesResult.Failure;
                    Result.AddMessage(
                        string.Format(
                            HttpContext.GetGlobalResourceObject(
                                string.Format("{0}_Rules", HLConfigManager.Platform),
                                "PurchaseLimitTypeProductCategory") as string ?? string.Empty,
                            cart.CurrentItems[0].SKU));
                    cart.RuleResults.Add(Result);
                    return(Result);
                }

                // validate against order threshold first
                decimal cartVolume = (cart as MyHLShoppingCart).VolumeInCart;
                if (PurchasingLimitProvider.IsOrderThresholdMaxVolume(PurchasingLimits) ||
                    PurchasingLimits.PurchaseLimitType != PurchaseLimitType.None)
                {
                    if (DistributorRemainingVolumePoints - (cartVolume + NewVolumePoints) < 0)
                    {
                        Result.Result = RulesResult.Failure;

                        string message = string.Empty;

                        if (cart.CartItems.Exists(item => item.SKU == cart.CurrentItems[0].SKU))
                        {
                            Result.Messages.Add(
                                string.Format(
                                    HttpContext.GetGlobalResourceObject(
                                        string.Format("{0}_Rules", HLConfigManager.Platform),
                                        "VolumePointExceedsThresholdByIncreasingQuantity") as string ?? string.Empty,
                                    cart.CurrentItems[0].SKU, cart.CurrentItems[0].Quantity));
                        }
                        else
                        {
                            Result.Messages.Add(
                                string.Format(
                                    HttpContext.GetGlobalResourceObject(
                                        string.Format("{0}_Rules", HLConfigManager.Platform),
                                        "VolumePointExceedsThreshold") as string ?? string.Empty, cart.CurrentItems[0].SKU));
                        }

                        if (Result.Messages.Any())
                        {
                            cart.RuleResults.Add(Result);
                        }
                        else
                        {
                            Result.Result = RulesResult.Success;
                        }

                        return(Result); // if fails, just return
                    }
                }

                if (PurchasingLimits.PurchaseLimitType == PurchaseLimitType.ProductCategory)
                {
                    if (DistributorRemainingVolumePoints -
                        ((cart as MyHLShoppingCart).VolumeInCart + NewVolumePoints) < 0)
                    {
                        Result.Result = RulesResult.Failure;
                        if (cart.CartItems.Exists(item => item.SKU == cart.CurrentItems[0].SKU))
                        {
                            Result.AddMessage(
                                string.Format(
                                    HttpContext.GetGlobalResourceObject(
                                        string.Format("{0}_Rules", HLConfigManager.Platform),
                                        "VolumePointExceedsThresholdByIncreasingQuantity") as string ?? string.Empty,
                                    cart.CurrentItems[0].SKU, cart.CurrentItems[0].Quantity));
                        }
                        else
                        {
                            Result.AddMessage(
                                string.Format(
                                    HttpContext.GetGlobalResourceObject(
                                        string.Format("{0}_Rules", HLConfigManager.Platform),
                                        "VolumePointExceedsThreshold") as string ?? string.Empty, cart.CurrentItems[0].SKU));
                        }
                    }
                }
                else
                {
                    Result.Result = RulesResult.Success;
                }
            }
            return(Result);
        }