コード例 #1
0
        /// <summary>
        /// Create Ticket of Dinerware customer in Dinerware system
        /// </summary>
        /// <param name="userId">UserId</param>
        /// <param name="objwsTrialTicket">TrialTicket Details</param>
        public int CreateTickets(int userId, wsTrialTicket objwsTrialTicket, string cartExternalId = "")
        {
            try
            {
                var createTicketsResponse = _virtualDinerwareClient.TrialCommit(userId, objwsTrialTicket);

                int commitTicketId = _virtualDinerwareClient.CommitPendingTicket(createTicketsResponse.PendingID, new wsTransaction());

                if (commitTicketId > 0)
                {
                    int[] ticketArr = { commitTicketId };
                    if (objwsTrialTicket.CustomerID > 0)
                    {
                        _virtualDinerwareClient.AssociateCustomerTickets(userId, ticketArr, objwsTrialTicket.CustomerID);
                    }
                }

                return(commitTicketId);
            }
            catch (Exception ex)
            {
                _logger.WriteLogError(ex, "VirtualDinerwareClient CreateTickets");
            }
            return(0);
        }