Ejemplo n.º 1
0
        public Task <JResponseEntity <UserOperationHistoryEntity> > CreateAsync(UserOperationHistories Entity)
        {
            JResponseEntity <UserOperationHistoryEntity> ResponseObj = new JResponseEntity <UserOperationHistoryEntity>();

            try
            {
                //_context.UserOperationHistories.Add(Entity);
                //_context.SaveChanges();
                //ResponseObj.Status = true;
                //ResponseObj.Data = new UserOperationHistoryEntity()
                //{
                //    id = Entity.Id,
                //    buyPrice = Entity.BuyPrice,
                //    conversionUSD = Entity.ConversionValue,
                //    amount = Entity.Amount,
                //    totalConverted = Entity.TotalConverted,
                //    total = Entity.Total,
                //    userId = Entity.User.Id,
                //    ProductId = Entity.Product.Id
                //};
            }
            catch (Exception e)
            {
                ResponseObj.Message = e.InnerException != null ? e.InnerException.Message : e.Message;
            }
            return(Task.FromResult(ResponseObj));
        }
Ejemplo n.º 2
0
        public async Task <JResponseEntity <UserOperationHistoryEntity> > AddOperation(UserOperationHistoryEntity Entity)
        {
            JResponseEntity <UserOperationHistoryEntity> RObj = new JResponseEntity <UserOperationHistoryEntity>();

            if (Entity.amount != 0 && Entity.buyPrice != 0 && Entity.total != 0 && Entity.totalConverted != 0)
            {
                UserOperationHistories UserOpEntity = null; // (UserOperationHistories)Entity;
                UserOpEntity.UserId = Entity.userId;
                //UserOpEntity.ProductsId = Entity.ProductsId;

                RObj = await _UserOperationsService.CreateAsync(UserOpEntity);

                RObj.Message = "Added with success.";
            }
            else
            {
                RObj.Message = "Fields are missing.";
            }
            return(RObj);
        }
Ejemplo n.º 3
0
 public Task <JResponseEntity <UserOperationHistoryEntity> > UpdateAsync(UserOperationHistories Entity)
 {
     throw new NotImplementedException();
 }