public List <AssignableHistoricalExerciseDetail> AssignableHistoricalExerciseDetail(string beginDate, string endDate)
        {
            DateTime begin, end;
            bool     success = DateTime.TryParseExact(beginDate, SZKingdomDateFormat, null, DateTimeStyles.None, out begin);

            success &= DateTime.TryParseExact(endDate, SZKingdomDateFormat, null, DateTimeStyles.None, out end);
            if (!success)
            {
                return(null);
            }

            AssignableHistoricalExerciseDetailArguments arguments = new AssignableHistoricalExerciseDetailArguments
            {
                CustomerCode        = FCIdentity.CustomerCode,
                CustomerAccountCode = FCIdentity.CustomerAccountCode,
                BeginDate           = begin,
                EndDate             = end,
            };
            EntityResponse <List <AssignableHistoricalExerciseDetail> > result = _orderManager.AssignableHistoricalExerciseDetail(arguments);

            return(Mapper.Map <List <AssignableHistoricalExerciseDetail> >(result.Entity));
        }
Example #2
0
        public EntityResponse <List <AssignableHistoricalExerciseDetail> > AssignableHistoricalExerciseDetail(AssignableHistoricalExerciseDetailArguments assignableHistoricalExerciseDetailArguments)
        {
            List <SZKingdomArgument> arguments = new List <SZKingdomArgument>();

            arguments.Add(SZKingdomArgument.CustomerCode(assignableHistoricalExerciseDetailArguments.CustomerCode));
            arguments.Add(SZKingdomArgument.CustomerAccountCode(assignableHistoricalExerciseDetailArguments.CustomerAccountCode));
            arguments.Add(SZKingdomArgument.Currency(assignableHistoricalExerciseDetailArguments.Currency));
            arguments.Add(SZKingdomArgument.StockBoard(assignableHistoricalExerciseDetailArguments.StockBoard));

            arguments.Add(SZKingdomArgument.TradeAccount(assignableHistoricalExerciseDetailArguments.TradeAccount));
            arguments.Add(SZKingdomArgument.OptionNumber(assignableHistoricalExerciseDetailArguments.OptionNumber));
            arguments.Add(SZKingdomArgument.OptionUnderlyingCode(assignableHistoricalExerciseDetailArguments.OptionUnderlyingCode));
            arguments.Add(SZKingdomArgument.OptionType(assignableHistoricalExerciseDetailArguments.OptionType));
            arguments.Add(SZKingdomArgument.OptionCoveredFlag(assignableHistoricalExerciseDetailArguments.OptionCoveredFlag));
            arguments.Add(SZKingdomArgument.ExerciseSide(assignableHistoricalExerciseDetailArguments.ExerciseSide));
            arguments.Add(SZKingdomArgument.QueryPosition(assignableHistoricalExerciseDetailArguments.QueryPosition));
            arguments.Add(SZKingdomArgument.QueryNumer(assignableHistoricalExerciseDetailArguments.QueryNumer));
            arguments.Add(SZKingdomArgument.BeginDate(assignableHistoricalExerciseDetailArguments.BeginDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            arguments.Add(SZKingdomArgument.EndDate(assignableHistoricalExerciseDetailArguments.EndDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            //if (orderArguments.SecurityLevel != SecurityLevel.NoSecurity)
            //{
            //    if (!string.IsNullOrWhiteSpace(orderArguments.SecurityInfo))
            //    {
            //        arguments.Add(SZKingdomArgument.SecurityInfo(orderArguments.SecurityInfo));
            //    }
            //    else if (!string.IsNullOrWhiteSpace(orderArguments.Password))
            //    {
            //        orderArguments.SecurityInfo = _marketDataLibrary.EncryptPassword(orderArguments.CustomerAccountCode, orderArguments.Password);
            //    }
            //    else
            //    {
            //        EntityResponse<OptionOrderInformation> entityResponse = EntityResponse<OptionOrderInformation>
            //            .Error(ErrorCode.SZKingdomLibraryError, "No security info");
            //        return entityResponse;
            //    }
            //}

            EntityResponse <List <AssignableHistoricalExerciseDetail> > result =
                _marketDataLibrary.ExecuteCommandList <AssignableHistoricalExerciseDetail>(SZKingdomRequest.AssignableHistoricalExerciseDetail, arguments);

            return(result);
        }