Ejemplo n.º 1
0
        public int InsertOrderHistory(int StoreId, int LoggedInUserId, OrderHistoryEntity objHistoryEntity)
        {
            var ParameterStoreId = new SqlParameter
            {
                ParameterName = "StoreId",
                DbType        = DbType.Int32,
                Value         = StoreId
            };
            var ParameterLoggedInUserId = new SqlParameter
            {
                ParameterName = "LoggedInUserId",
                DbType        = DbType.Int32,
                Value         = LoggedInUserId
            };
            var paramOrderId = new SqlParameter {
                ParameterName = "order_id", DbType = DbType.Int32, Value = objHistoryEntity.order_id
            };
            var paramnotify = new SqlParameter {
                ParameterName = "notify", DbType = DbType.Int32, Value = objHistoryEntity.notify
            };
            var paramcomment = new SqlParameter {
                ParameterName = "comment", DbType = DbType.String, Value = objHistoryEntity.comment
            };
            var paramorderStatusId = new SqlParameter {
                ParameterName = "order_status_id", DbType = DbType.Int32, Value = objHistoryEntity.order_status_id
            };
            int result = objGenericRepository.ExecuteSQL <int>("InsertOrderHistory", paramOrderId, paramnotify, paramcomment, paramorderStatusId).FirstOrDefault();

            return(result);
        }
Ejemplo n.º 2
0
        public Task AddAsync(IOrderHistory order, ITrade trade)
        {
            var entity = OrderHistoryEntity.Create(order);

            // ReSharper disable once RedundantArgumentDefaultValue
            //TODO: use event datetime
            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity,
                                                                        DateTime.UtcNow, RowKeyDateTimeFormat.Iso));
        }
        public void Create(OrderHistory orderHistory)
        {
            string date = DateTime.UtcNow.ToString("MM-dd-yyyy");
            string time = DateTime.Now.ToString("HH:mm");

            var Entity = new OrderHistoryEntity {
                CustomerId = orderHistory.CustomerId, LocationId = orderHistory.LocationId, Date = date, Time = time
            };

            _context.OrderHistoryEntity.Add(Entity);

            _context.SaveChanges();
        }
        private async Task DoAdd(SqlConnection conn, SqlTransaction transaction, IOrderHistory order, ITrade trade)
        {
            var orderHistoryEntity = OrderHistoryEntity.Create(order);
            await conn.ExecuteAsync(
                $"insert into {TableName} ({GetColumns}) values ({GetFields})",
                orderHistoryEntity,
                transaction);

            if (trade != null)
            {
                var tradeEntity = TradeEntity.Create(trade);
                await conn.ExecuteAsync(
                    $"insert into {TradesSqlRepository.TableName} ({TradesSqlRepository.GetColumns}) values ({TradesSqlRepository.GetFields})",
                    tradeEntity,
                    transaction);
            }
        }
Ejemplo n.º 5
0
 public HttpResponseMessage InsertOrderHistory(int StoreId, int LoggedInUserId, OrderHistoryEntity objHistoryEntity)
 {
     try
     {
         var result = _orderService.InsertOrderHistory(StoreId, LoggedInUserId, objHistoryEntity);
         return(Request.CreateResponse(HttpStatusCode.OK, result));
     }
     catch (Exception)
     {
         throw;
     }
 }