TierLevelInfo CreateTierInfo(int tierId) { var result = new TierLevelInfo(); result.TierId = tierId; return(result); }
TierLevelViewModel CreateTierObject(TierLevelInfo inInfo) { var result = new TierLevelViewModel(); result.Name = inInfo.Name; result.TierLevelNumber = inInfo.Level; result.BirthdayBonus = inInfo.BirthdayBonus; result.PointsRequired = inInfo.PointsRequired; result.RedeemPointsRate = inInfo.PricedRedemptionRate; result.WeightedRedeemPoints = inInfo.WeighedRedemptionPoints; result.WeightedRedeemPointsValue = inInfo.WeighedRedemptionWeight; result.SendMailToHeadQuarter = inInfo.SendMailToHeadOffice; result.ChangeCard = inInfo.ChangeCard; result.SendMailToUser = inInfo.SendMailToMember; result.AllowEarntLoyaltyRedemption = inInfo.AllowEarntLoyaltyRedemption; return(result); }
TierLevelInfo CreateTierInfo(ApiTierLevelViewModel inTierInfo) { var result = new TierLevelInfo(); result.TierId = Convert.ToInt32(inTierInfo.TierLevelId); result.Name = inTierInfo.Name; result.Level = inTierInfo.TierLevelNumber; result.BirthdayBonus = inTierInfo.BirthdayBonus; result.PointsRequired = inTierInfo.PointsRequired; result.PricedRedemptionRate = inTierInfo.RedeemPointsRate; result.WeighedRedemptionPoints = inTierInfo.WeightedRedeemPoints; result.WeighedRedemptionWeight = inTierInfo.WeightedRedeemPointsValue; result.SendMailToHeadOffice = inTierInfo.SendMailToHeadQuarter; result.ChangeCard = inTierInfo.ChangeCard; result.SendMailToMember = inTierInfo.SendMailToUser; result.AllowEarntLoyaltyRedemption = inTierInfo.AllowEarntLoyaltyRedemption; return(result); }
LoyaltyTierResponse CreateTierInTheCloud(string inSyndicateCode, TierLevelInfo inInfo) { try { ILoyaltymateService loyaltymateService = new LoyaltymateService(); var response = loyaltymateService.SaveTierLevel(CreateTierObject(inInfo), inSyndicateCode); return(CreateTierResponseNoError(CreateTierInfo(response))); } catch (AuthenticationFailedException ex) { return(CreateTierResponseError( @"Failed to Authenticate", ex.Message, LoyaltyResponseCode.AuthenticationFailed, CreateTierInfo(0))); } catch (Exception exc) { return(CreateTierResponseError(@"Failed to create a tier in the Cloud", exc.Message, LoyaltyResponseCode.CreateTierFailed, CreateTierInfo(0))); } }
public LoyaltyTierResponse SaveTierLevel(string inSyndicateCode, TierLevelInfo inInfo) { return(CreateTierInTheCloud(inSyndicateCode, inInfo)); }