示例#1
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;
     }
 }
示例#2
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;
            }
        }