示例#1
0
        public async Task DeleteOrder(DeleteOrderDto dto)
        {
            var item = await _writeRepository.GetAsync(dto.OrderId);

            item.Delete();
            Logger.LogInformation($"DELETED ORDER: {dto.OrderId}");
        }
示例#2
0
        public async Task WhenAsync(DeleteOrderDto c)
        {
            var idObj         = (c as IDeleteOrder).OrderId;
            var uriParameters = new OrderUriParameters();

            uriParameters.Id = idObj;

            var q = new OrderDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.Version);

            var req = new OrderDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.Order.Delete(req);

            OrderProxyUtils.ThrowOnHttpResponseError(resp);
        }
示例#3
0
        /// <summary>
        /// (+)  刪除訂單
        /// </summary>
        /// <param name="uid">使用者uid</param>
        /// <param name="data">訂購時間</param>
        public void Delete(string uid, DeleteOrderDto data)
        {
            //var query = Builders<Member_M>.Filter.Eq(t => t.UID, userUid);
            //var set = Builders<Member_M>.Update.Set(p => p.status.text, status);
            collection.DeleteOne(t => t.uid == uid &&
                                 //t.type == data.type &&
                                 t.restaurant == data.restaurant &&

                                 t.updateDate >= data.date &&
                                 t.updateDate < data.date.AddDays(1)
                                 //t.meal == data.meal
                                 );


            //collection.DeleteOne(a => a.uid == uid);

            //collection.DeleteOne(a => a.uid == uid &&
            //                                        a.orderTime.ToString("yyyyMMdd") == orderTime.ToString("yyyyMMdd"));


            //var query = Query<Order_M>.EQ(p => p.uid, "");
            //collection.Remove(query, RemoveFlags.Single, WriteConcern.Unacknowledged);
        }
示例#4
0
 public void When(DeleteOrderDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }
示例#5
0
 /// <summary>
 /// (+)  刪除訂單
 /// </summary>
 public void DeleteOrder(DeleteOrderDto data)
 {
     _repository.Delete(Uid, data);
 }
示例#6
0
        public async Task DeleteOrder(DeleteOrderDto dto)
        {
            var item = await _writeRepository.GetAsync(dto.OrderId);

            item.Delete();
        }