public CheckTransaction CheckTransactionHash(string email, int buyId) { var user = UserBusiness.GetValidUser(email); var buy = BuyBusiness.Get(buyId); if (buy == null || buy.UserId != user.Id || buy.LastTransaction == null) { throw new ArgumentException("Invalid purchase."); } var status = buy.LastTransaction.TransactionStatus; if (status == TransactionStatus.Success.Value || status == TransactionStatus.Pending.Value) { if (status == TransactionStatus.Pending.Value) { status = CheckAndProcessTransaction(buy.LastTransaction, buy.Id).Value; } if (status == TransactionStatus.Success.Value) { var portfolio = PortfolioBusiness.GetSimple(buy.PortfolioId); return(new CheckTransaction() { Status = status, Distribution = DistributionBusiness.ListByProjection(portfolio.ProjectionId.Value) }); } } return(new CheckTransaction() { Status = status }); }
public List <Model.Portfolio.Distribution> ListPortfolioDistribution(string email, int portfolioId) { return(DistributionBusiness.ListByUserPortfolio(email, portfolioId)); }
public List <Distribution> CreateDistribution(string email, int portfolioId, Dictionary <int, double> distribution) { return(DistributionBusiness.Create(email, portfolioId, distribution)); }