public void BuyTicket(string email, int visitorId) { if (connection.BuyTicket(visitorId, email, totalPrice)) { lbRegisterStatus.Background = Brushes.Green; lbRegisterStatus.Content = "Ticket bought"; btnBuyTicket.IsEnabled = true; campspotToggleSwitch.IsEnabled = true; //This code sends an email to the user with the QR code as an attachment, we just dont have an official email from which we can send the email //int ticketId = connection.GetTicketIdFromEmail(email); //QRCode barcode = new QRCode(ticketId.ToString()); //barcode.XDimension = 30; //barcode.Draw(@"C:\Users\user\Desktop\Prop\ProP_Group_31\SypnosisApp\SypnosisApp\QRCodes\Visitor" + visitorId + "QR.Png", 300, ImageFormat.Png); //have to make the path to the local folder //connection.SendEmail(email, visitorId); } else { lbRegisterStatus.Background = Brushes.Red; lbRegisterStatus.Content = "Something went wrong/Not enough balance"; } }