public static ConfirmPayoutResult ConfirmPayout(string protoIdentity) { protoIdentity = HttpUtility.UrlDecode(protoIdentity); AuthenticationData authData = GetAuthenticationDataAndCulture(); if ( !authData.Authority.HasAccess(new Access(authData.CurrentOrganization, AccessAspect.Financials, AccessType.Write))) { throw new SecurityException("Insufficient privileges for operation"); } ConfirmPayoutResult result = new ConfirmPayoutResult(); Payout payout = Payout.CreateFromProtoIdentity(authData.CurrentUser, protoIdentity); PWEvents.CreateEvent(EventSource.PirateWeb, EventType.PayoutCreated, authData.CurrentUser.Identity, 1, 1, 0, payout.Identity, protoIdentity); // Create result and return it result.AssignedId = payout.Identity; result.DisplayMessage = String.Format(Resources.Pages.Financial.PayOutMoney_PayoutCreated, payout.Identity, payout.Recipient); return(result); }
public static ConfirmPayoutResult ConfirmPayout (string protoIdentity) { protoIdentity = HttpUtility.UrlDecode(protoIdentity); AuthenticationData authData = GetAuthenticationDataAndCulture(); if (!authData.CurrentUser.HasAccess(new Access(authData.CurrentOrganization, AccessAspect.Financials, AccessType.Write))) { throw new SecurityAccessDeniedException("Insufficient privileges for operation"); } ConfirmPayoutResult result = new ConfirmPayoutResult(); Payout payout = Payout.CreateFromProtoIdentity(authData.CurrentUser, protoIdentity); Swarmops.Logic.Support.PWEvents.CreateEvent(EventSource.PirateWeb, EventType.PayoutCreated, authData.CurrentUser.Identity, 1, 1, 0, payout.Identity, protoIdentity); // Create result and return it result.AssignedId = payout.Identity; result.DisplayMessage = String.Format(Resources.Pages.Financial.PayOutMoney_PayoutCreated, payout.Identity, payout.Recipient); result.DisplayMessage = HttpUtility.UrlEncode(result.DisplayMessage).Replace("+", "%20"); return result; }