示例#1
0
        private string UpdatedOrCancelMembership_Worker(MembershipDataInput membershipDataInput,
                                                        MembershipActionType membershipAction, ref string message)
        {
            // GITCS-9 : Support Activation or Cancellation via new model computed member :
            // MembershipDetails membershipDetails = _membershipdataAccess.GetMembershipDetails( membershipDataInput.CancelationOrActivationKey  );
            MembershipDetails membershipDetails =
                _membershipdataAccess.GetMembershipDetails <string, MembershipDetails>(membershipDataInput.CancelationOrActivationKey);

            MembershipActionType actionToRun = membershipAction;


            switch (actionToRun)
            {
            case MembershipActionType.Decline:
                message = _membershipdataAccess.DeclineMembership(membershipDataInput);
                break;

            case MembershipActionType.Activate:
                message = _membershipdataAccess.UpdateMembership(membershipDataInput);
                break;

            case MembershipActionType.Cancel:
                // GICTS-9 : Implement this branch for cancellation ...
                message = _membershipdataAccess.CancelMembership(membershipDataInput);
                break;

            case MembershipActionType.DoNothing:
                message = "";
                break;

            default:
                throw new Exception($"Unexpected Action to Run: {actionToRun}");
                break;
            }

            return(membershipDetails.CustomerId);
        }
 public string DeclineMembership(MembershipDataInput input)
 {
     return(_dataAccess.DeclineMembership(input));
 }