public static bool IsFor(this IAccountDependency accountDependency, Account account, AccountUser owner, AccountLevelPolicy accountLevel, DateTime now) { var levels = accountDependency.AccountLevels.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (accountLevel != null && !levels.Contains(accountLevel.AccountLevelPolicyId.ToString())) { return(false); } if ((accountDependency.DependencyType & AccountDependencyTypes.BirthDate) != 0) { if (owner != null && owner.BirthDate != null && owner.BirthDate.Value.IsBirthday(now)) { return(true); } } return(IsFor(accountDependency, now)); }
public static string FormatTickForRecharging(string message, Site site, bool hasReceipt, decimal amount, string howToDeal, DealLog deal, Account account, AccountType accountType, AccountUser owner, User @operator) { message = MessageFormator.Format(message, account); message = MessageFormator.Format(message, amount); //message = MessageFormator.Format(message, owner); //message = MessageFormator.Format(message, site); //message = hasReceipt ? message.Replace("#is-recharged#", "发票已开据") : message.Replace("#is-recharged#", ""); //message = MessageFormator.FormatForOperator(message, @operator); message = MessageFormator.Format(message, owner); //message = MessageFormator.Format(message, accountType); message = MessageFormator.Format(message, deal); //message = MessageFormator.FormatHowToDeal(message, howToDeal); return(message); }
public static string FormatTickForRenewAccount(string message, string serialNo, Site site, Account account, AccountUser owner, AccountType accountType, User @operator) { message = MessageFormator.FormatForSerialNo(message, serialNo); message = MessageFormator.Format(message, site); message = MessageFormator.Format(message, owner); message = MessageFormator.Format(message, account); message = MessageFormator.Format(message, accountType); message = MessageFormator.FormatForOperator(message, @operator); return(message); }
public static string FormatTickForChangeAccountName(string message, Site site, string serialNo, string oldAccountName, Account account, AccountUser owner, AccountType accountType, User @operator) { message = Format(message, site); message = FormatForSerialNo(message, serialNo); message = message.Replace("#account-name#", oldAccountName); message = message.Replace("#account-new-name#", account.Name); message = Format(message, account); message = Format(message, owner); message = Format(message, accountType); message = FormatForOperator(message, @operator); return(message); }