예제 #1
0
        private string UpdateText(string originalString, BlueGreenContext userContext)
        {
            if (originalString != null)
            {
                originalString = originalString.Replace("{availablepoints}", userContext.GetPoints().ToString("N0"));
                if (originalString.Contains("{futurepoints}") && userContext.GetFuturePoints() == 0)
                {
                    originalString = "";
                }
                else
                {
                    originalString = originalString.Replace("{futurepoints}", userContext.GetFuturePoints().ToString("N0"));
                }
                originalString = originalString.Replace("{ownershiplevel}", userContext.GetOwnershipLevel());
                originalString = originalString.Replace("{bluegreenrewards}", FormatUtils.FormatPoints(userContext.GetRewards().ToString()));
                originalString = originalString.Replace("{expirationdate}", UiUtils.ConvertDateToString(userContext.OwnerExpiration));
                originalString = originalString.Replace("{paymentbalance}", userContext.GetBalance().ToString("C"));

                if (!string.IsNullOrEmpty(userContext.GetAvailableWeek()))
                {
                    originalString = originalString.Replace("{availableweeks}", userContext.GetAvailableWeek());
                }
            }

            return(originalString);
        }