public TicketInfoMessage(TicketInfoMessage msg) { this.TripInfo = msg.TripInfo; this.SeatId = msg.SeatId; this.EmpId = msg.SeatId; this.ClientId = msg.ClientId; this.TicketPrice = msg.TicketPrice; }
public ClientInfoViewModel() { SaveClientInfoCmd = new RelayCommand<ClientInfoWindow>(this.SaveClientInfo); Messenger.Default.Register<TicketInfoMessage>(this, (msg) => { this.message = msg; }); }
public TicketViewModel() { PrintTicketCmd = new RelayCommand<object>(PrintTicket); Messenger.Default.Register<TicketInfoMessage>(this, (msg) => { if (msg.IsForPrint) { ticketMessage = msg; SetTicketInfo(); } }); }
private void SaveClientInfo(ClientInfoWindow window) { if (!String.IsNullOrEmpty(FIO) && !String.IsNullOrEmpty(PassportNum)) { var client = new Client(); client.FullName = this.FIO; client.PassportNum = this.PassportNum; ContextKeeper.Clients.Add(client); this.message.ClientId = client.Id; BuyTicket(); var ticket = new TicketWindow(); ticket.Show(); var printTicketMsg = new TicketInfoMessage(message); printTicketMsg.IsForPrint = true; Messenger.Default.Send(printTicketMsg); window.Close(); } }