/// <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);
        }
Beispiel #2
0
        /// <summary>
        /// Create Ticket of Dinerware customer in the Dinerware system
        /// </summary>
        /// <param name="userId">UserId</param>
        /// <param name="objwsTrialTicket">TrialTicket Details</param>
        public void CreateTickets(int userId, wsTrialTicket objwsTrialTicket)
        {
            var createTicketsResponse = virtualDinerwareClient.TrialCommit(userId, objwsTrialTicket);
            int pendingTicketId       = createTicketsResponse.PendingID;
            var committedTicket       = virtualDinerwareClient.CommitPendingTicketWithNoTransaction(pendingTicketId);

            //decimal TaxTotal = createTicketsResponse.TaxTotal;
            //decimal TicketTotal = createTicketsResponse.TicketTotal;
            //wsTransaction objwsTransaction = new wsTransaction();
            //objwsTransaction.ExchangeAmount = 0;
            //objwsTransaction.ExchangeRate = 0;
            //objwsTransaction.RefNumber = pendingTicketId.ToString();

            //virtualDinerwareClient.addTransactionToTicket(userId, committedTicket, objwsTransaction);

            //virtualDinerwareClient.CommitPendingTicket(pendingTicketId, objwsTransaction);
        }
Beispiel #3
0
        private void btnOpenTab_Click(object sender, EventArgs e)
        {
            wsTrialTicket trialticker = new wsTrialTicket();
            trialticker.TicketName = txtCustomerName.Text + "-" + txtPIN.Text;
            trialticker.SchemaNumber = dwvc.GetSchema();

            Int32 pendingID =  dwvc.TrialCommit(0, trialticker ).PendingID;

            Int32 ticketId = dwvc.CommitPendingTicketWithNoTransaction(pendingID);

            wsPerson p = new wsPerson();
            p.MEMBERSHIP_ID = "123";
            p.FNAME = "Owais Aized";
            Int32[] arr = new Int32[1];
            arr[0] = ticketId;
               Int32 customerId =  dwvc.AddCustomer(0, p);
               dwvc.AssociateCustomerTickets(0, arr, customerId);
        }
Beispiel #4
0
 /// <summary>
 /// Create Ticket of Dinerware customer in the Dinerware system
 /// </summary>
 /// <param name="userId">UserId</param>
 /// <param name="customer">Customer</param>
 public void CreateTickets(int userId, wsPerson customer)
 {
     try
     {
         DinerwareProvider objDinerwareProvider = new DinerwareProvider();
         wsTrialTicket     objwsTrialTicket     = new wsTrialTicket();
         objwsTrialTicket.CreateTime = DateTime.UtcNow;
         if (!string.IsNullOrEmpty(customer.ID))
         {
             objwsTrialTicket.CustomerID = int.Parse(customer.ID);
         }
         objwsTrialTicket.TicketName = customer.LNAME + Constants.COMMA_BLANK_SPACE + customer.FNAME;
         objDinerwareProvider.CreateTickets(userId, objwsTrialTicket);
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Create Ticket of Dinerware customer in Dinerware system
        /// </summary>
        /// <param name="userId">UserId</param>
        /// <param name="customer">Customer</param>
        private int CreateTickets(int userId, wsPerson customer, string cartExternalId)
        {
            DinerwareProvider objDinerwareProvider = new DinerwareProvider();

            try
            {
                wsTrialTicket objwsTrialTicket = new wsTrialTicket();
                objwsTrialTicket.CreateTime = DateTime.UtcNow;

                if (!string.IsNullOrWhiteSpace(customer.ID))
                {
                    objwsTrialTicket.CustomerID = int.Parse(customer.ID);
                }

                objwsTrialTicket.TicketName = $"{customer.LNAME}, {customer.FNAME}";

                return(objDinerwareProvider.CreateTickets(userId, objwsTrialTicket, cartExternalId));
            }
            catch (Exception ex)
            {
                _logger.WriteLogError(ex, "CreateTickets");
                throw ex;
            }
        }
        private int AddUsersTOTicketinDinnerware(Dictionary<string, object> dictinory)
        {
            // Get Title
            object title = null;
            dictinory.TryGetValue("name", out title);

            //Get PinCode
            object PicCode = null;
            dictinory.TryGetValue("id", out PicCode);

            string TicketTitle = title.ToString() + "-" + PicCode.ToString();

            wsTrialTicket trialticker = new wsTrialTicket();
            trialticker.TicketName = TicketTitle;
            trialticker.SchemaNumber = dwvc.GetSchema();

            Int32 pendingID = dwvc.TrialCommit(0, trialticker).PendingID;

            return dwvc.CommitPendingTicketWithNoTransaction(pendingID);
        }
        private int CreateTicketsinDinnerware(Dictionary<string, object> dictinory)
        {
            // Get Title
            object title = null;
            dictinory.TryGetValue("name", out title);

            //Get PinCode
            object PicCode = null;
            dictinory.TryGetValue("pin_code", out PicCode);

            //Get PinCode
            object Ticket_ID = null;
            dictinory.TryGetValue("ticket_id", out Ticket_ID);

            //Get PinCode
            object email = null;
            dictinory.TryGetValue("email", out email);

            //Get PinCode
            object fname = null;
            dictinory.TryGetValue("first_name", out fname);

            //Get PinCode
            object lname = null;
            dictinory.TryGetValue("last_name", out lname);

            string TicketTitle = "PreGame-" + PicCode.ToString();

            wsTrialTicket trialticker = new wsTrialTicket();
            trialticker.TicketName = TicketTitle;
            trialticker.SchemaNumber = dwvc.GetSchema();

            Int32 pendingID = dwvc.TrialCommit(0, trialticker).PendingID;

            Int32 POS_Ticket_ID = dwvc.CommitPendingTicketWithNoTransaction(pendingID);
            Int32 customerid = 0;
            Person[] customers = dwvc.GetCustomersByEmail(email.ToString());
            if (customers.Length == 0)
            {
                wsPerson p = new wsPerson();
                p.FNAME = fname.ToString();
                p.LNAME = lname.ToString();
                p.EMAIL = email.ToString();

                customerid = dwvc.AddCustomer(0, p);

            }
            else
            {
                customerid = Convert.ToInt32(customers[0].ID);
            }
            Int32[] arr = new Int32[1];
            arr[0] = POS_Ticket_ID;
            dwvc.AssociateCustomerTickets(0, arr, customerid);

            return POS_Ticket_ID;
            //List<Dictionary<string, object>> jsonUsersResults = new List<Dictionary<string, object>>();
            //jsonUsersResults = PreGameAPICaller.GetPreGameTickersUsers(Ticket_ID.ToString());
        }