public void UnlockShares(StockLockingViewModel stockViewModel) { UnderlyingSecurityLockUnlockArguments orderArguments = new UnderlyingSecurityLockUnlockArguments { CustomerAccountCode = FCIdentity.CustomerAccountCode, TradeAccount = FCIdentity.TradeAccount, SecurityCode = stockViewModel.SecurityCode, OrderQuantity = stockViewModel.Quantity, StockBusiness = StockBusiness.UnlockSecurities, Password = FCUser.Password, InternalOrganization = Convert.ToString(FCUser.InternalOrganization) }; UnderlyingSecurityLockUnlockInformation order = _orderManager.LockUnlockUnderlyingSecurity(orderArguments); }
public EntityResponse <UnderlyingSecurityLockUnlockInformation> LockUnlockUnderlyingSecurity( UnderlyingSecurityLockUnlockArguments lockUnlockArguments) { List <SZKingdomArgument> arguments = new List <SZKingdomArgument>(); arguments.Add(SZKingdomArgument.CustomerAccountCode(lockUnlockArguments.CustomerAccountCode)); arguments.Add(SZKingdomArgument.TradeAccount(lockUnlockArguments.TradeAccount)); arguments.Add(SZKingdomArgument.StockBoard(lockUnlockArguments.StockBoard)); arguments.Add(SZKingdomArgument.SecurityCode(lockUnlockArguments.SecurityCode)); arguments.Add(SZKingdomArgument.OrderQuantity(lockUnlockArguments.OrderQuantity)); arguments.Add(SZKingdomArgument.StockBusiness(lockUnlockArguments.StockBusiness)); arguments.Add(SZKingdomArgument.StockBusinessAction(StockBusinessAction.OrderDeclaration)); arguments.Add(SZKingdomArgument.SecurityLevel(lockUnlockArguments.SecurityLevel)); arguments.Add(SZKingdomArgument.InternalOrganization(lockUnlockArguments.InternalOrganization)); if (lockUnlockArguments.SecurityLevel != SecurityLevel.NoSecurity) { lockUnlockArguments.SecurityInfo = _marketDataLibrary.EncryptPassword(lockUnlockArguments.CustomerAccountCode, lockUnlockArguments.Password); if (!string.IsNullOrWhiteSpace(lockUnlockArguments.SecurityInfo)) { arguments.Add(SZKingdomArgument.SecurityInfo(lockUnlockArguments.SecurityInfo)); } else { EntityResponse <UnderlyingSecurityLockUnlockInformation> entityResponse = EntityResponse <UnderlyingSecurityLockUnlockInformation> .Error(ErrorCode.SZKingdomLibraryError, "No security info"); return(entityResponse); } } arguments.Add(SZKingdomArgument.CustomerCode(lockUnlockArguments.CustomerCode)); arguments.Add(SZKingdomArgument.TradeUnit(lockUnlockArguments.TradeUnit)); arguments.Add(SZKingdomArgument.OrderBatchSerialNo(lockUnlockArguments.OrderBatchSerialNo)); arguments.Add(SZKingdomArgument.ClientInfo(lockUnlockArguments.ClientInfo)); EntityResponse <UnderlyingSecurityLockUnlockInformation> result = _marketDataLibrary .ExecuteCommandSingleEntity <UnderlyingSecurityLockUnlockInformation>(SZKingdomRequest.UnderlyingSecurityLockUnlock, arguments); return(result); }