예제 #1
0
        public Wit_Transaction SetTransactionStatus(string transactionID, string status)
        {
            try
            {
                var trans = GetByIdAsync(new Guid(transactionID)).Result;
                if (trans == null)
                {
                    LogMsg("Transaction does not exist");
                    return(trans);
                }

                Wit_Status wit_status = new Wit_Status();
                if (!wit_status.IsStatusValid(status))
                {
                    return(null);
                }

                trans.Status = status;
                UpdateAsync(trans, string.Empty).Wait();
                return(trans);
            }
            catch (Exception ex)
            {
                LogMsg(ex.Message);
                throw ex;
            }
        }
예제 #2
0
 public Wit_Order SetOrderStatus(string orderID, string status)
 {
     try
     {
         var        order     = FindByIdAsync(new Guid(orderID)).Result;
         Wit_Status witStatus = new Wit_Status();
         if (order == null || witStatus.IsStatusValid(status))
         {
             return(order);
         }
         order.OrderStatus = status;
         UpdateAsync(order, string.Empty).Wait();
         return(order);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }