public string RetreivePassword(TicketingUsers user) { string pwd = string.Empty; Musika.Controllers.API.TicketingAPIController myController = new Musika.Controllers.API.TicketingAPIController(); myController.RetreivePassword(user); return(pwd); }
public string GetTicketingEvents() { Musika.Controllers.API.TicketingAPIController myController = new Musika.Controllers.API.TicketingAPIController(); string result = string.Empty; result = myController.GetTicketingEvents().ToString(); return(result); }
public bool CreateEvent([System.Web.Http.FromBody] TicketingEventsNewModel events) { Musika.Controllers.API.TicketingAPIController myController = new Musika.Controllers.API.TicketingAPIController(); myController.UpdateTicketingEvent(events); return(true); }
private void GenerateFreeTicket() { // Generate Ticket string data = string.Empty; string personalData = string.Empty; string qrCode = string.Empty; string email = string.Empty; string mode = "Card"; string img = string.Empty; int qty = 1; string ticketNumber = String.Empty; TicketEventDetails ticketDetails = new TicketEventDetails(); personalData += txtName.Text + "~" + txtAddress.Text + "~" + txtCountryState.Text + "~" + txtCity.Text + "~" + txtPostalCode.Text + "~" + txtPhone.Text; try { for (int i = 0; i < qty; i++) { data = tourDateId + "~" + userId + "~" + deviceId + "~" + ticketType + "~" + mode + "~" + qty; // Generate QR Code string dataTicket = Guid.NewGuid().ToString(); img = new Musika.Controllers.API.TicketingAPIController().GetZXingQRCode(dataTicket); ticketDetails = new Musika.Controllers.API.TicketingAPIController().GenerateTicketNumber(data, dataTicket, personalData, img); // Save in Database TicketingEventTicketConfirmation ticketConform = new TicketingEventTicketConfirmation(); ticketConform.EventID = Convert.ToInt32(ticketDetails.EventID); ticketConform.UserID = Convert.ToInt32(Request.QueryString["userId"].ToString()); ticketConform.Dob = DateTime.Now; ticketConform.Gender = ticketDetails.Gender; ticketConform.Address = ticketDetails.Address; ticketConform.City = ticketDetails.City; ticketConform.State = ticketDetails.State; ticketConform.Country = ticketDetails.Country; ticketConform.PostalCode = ticketDetails.PostalCode; ticketConform.Email = ticketDetails.Email; ticketConform.PhoneNumber = ticketDetails.PhoneNumber; ticketConform.TicketNumber = ticketDetails.TicketNumber; ticketConform.TicketType = ticketDetails.TicketType; ticketConform.Mode = ticketDetails.Mode; ticketConform.TicketSerialNumber = ticketDetails.TicketSerialNumber; ticketConform.ScannedTicket = img; ticketConform.TourDateID = tourDateId; bool res; res = new Musika.Repository.SPRepository.SpRepository().SpAddTicketingEventTicketConfirmation(ticketConform); if (res == true) { email = txtEmail.Text; // Send Mail to User string html = "<p>Hi," + txtName.Text + "</p>"; html += "<p>Thanks for using " + System.Configuration.ConfigurationManager.AppSettings["AppName"] + "! </p>"; html += "<p>The QR Code Image is attached along with the mail.</p>"; html += "<p>Event Name : " + ticketDetails.EventTitle; html += "<p>Venue Name : " + ticketDetails.VenueName; html += "<p>City : " + ticketDetails.City; html += "<p>State : " + ticketDetails.State; html += "<p>Ticket Number : " + ticketDetails.TicketNumber; html += "<p><br><br><strong>Thanks,The " + System.Configuration.ConfigurationManager.AppSettings["AppName"] + " Team</strong></p>"; //EmailHelper.SendEmail(email, System.Configuration.ConfigurationManager.AppSettings["AppName"] + " : QR Code", html); #region "Send Mail Implementation" MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.sendgrid.net"); string mailFrom = System.Configuration.ConfigurationManager.AppSettings["ADMIN_EMAIL"].ToString(); //mail.From = new MailAddress("*****@*****.**"); mail.From = new MailAddress(mailFrom); mail.To.Add(email); mail.Subject = "Ticketing Payment Confirmation"; mail.Body = Server.HtmlDecode(html); mail.Body = mail.Body.Replace("<p>", ""); mail.Body = mail.Body.Replace("</p>", "\r\n"); mail.Body = mail.Body.Replace("<br>", "\r"); System.Net.Mail.Attachment attachment; string filePath = Server.MapPath("/Content/QRCodeImages/" + img); attachment = new System.Net.Mail.Attachment(filePath); mail.Attachments.Add(attachment); SmtpServer.Port = 587; // 25; SmtpServer.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["ApiKey"], ConfigurationManager.AppSettings["ApiKeyPass"]); SmtpServer.EnableSsl = true; //SmtpServer.Send(mail); #endregion } else { lblmessage.Text = ""; } } } catch (Exception) { //Response.Write("Message : " + ee.Message); //Response.Write(ee.StackTrace); } }
// Make Payment by Card protected void btnpayment_Click(object sender, EventArgs e) { string data = string.Empty; string personalData = string.Empty; string qrCode = string.Empty; string email = string.Empty; string mode = "Card"; data = txtName.Text + txtCardNumber.Text; string img = string.Empty; int qty = 1; #region "Popup Message" //string title = "Musika Alert"; //string body = string.Empty; //body += "Before proceeding to make the payment check that the credit or debit card you will use in the purchase is highlighted. Only the holder of the card may withdraw the tickets corresponding to your order. You must present the credit or debit card with physical relief, identity document and printed confirmation (Indispensable)"; //body += "WE DO NOT ACCEPT CARDS WITHOUT RELIEF."; //body += "TERMS AND CONDITIONS UEPA TICKETS"; //body += "Musika is a registered trademark of Musika SRL, a leading provider of transaction processing, ticketing and bill payment services."; //body += "THE USER ACCEPTS VOLUNTARILY THE FOLLOWING TERMS AND CONDITIONS: "; //ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup2('" + title + "', '" + body + "');", true); #endregion string ticketNumber = String.Empty; TicketEventDetails ticketDetails = new TicketEventDetails(); personalData += txtName.Text + "~" + txtAddress.Text + "~" + txtCountryState.Text + "~" + txtCity.Text + "~" + txtPostalCode.Text + "~" + txtPhone.Text; try { for (int i = 0; i < qty; i++) { //userId,tourDateId,deviceId,ticketType,mode,qty data = tourDateId + "~" + userId + "~" + deviceId + "~" + ticketType + "~" + mode + "~" + qty; // Generate QR Code string dataTicket = Guid.NewGuid().ToString(); img = new Musika.Controllers.API.TicketingAPIController().GetZXingQRCode(dataTicket); ticketDetails = new Musika.Controllers.API.TicketingAPIController().GenerateTicketNumber(data, dataTicket, personalData, img); // Save in Database TicketingEventTicketConfirmation ticketConform = new TicketingEventTicketConfirmation(); ticketConform.EventID = Convert.ToInt32(ticketDetails.EventID); ticketConform.UserID = Convert.ToInt32(Request.QueryString["userId"].ToString()); ticketConform.Dob = DateTime.Now; ticketConform.Gender = ticketDetails.Gender; ticketConform.Address = ticketDetails.Address; ticketConform.City = ticketDetails.City; ticketConform.State = ticketDetails.State; ticketConform.Country = ticketDetails.Country; ticketConform.PostalCode = ticketDetails.PostalCode; ticketConform.Email = ticketDetails.Email; ticketConform.PhoneNumber = ticketDetails.PhoneNumber; ticketConform.TicketNumber = ticketDetails.TicketNumber; ticketConform.TicketType = ticketDetails.TicketType; ticketConform.Mode = ticketDetails.Mode; ticketConform.TicketSerialNumber = ticketDetails.TicketSerialNumber; ticketConform.ScannedTicket = img; ticketConform.TourDateID = tourDateId; bool res; res = new Musika.Repository.SPRepository.SpRepository().SpAddTicketingEventTicketConfirmation(ticketConform); if (res == true) { email = txtEmail.Text; // Send Mail to User string html = "<p>Hi," + txtName.Text + "</p>"; html += "<p>Thanks for using " + System.Configuration.ConfigurationManager.AppSettings["AppName"] + "! </p>"; html += "<p>Your Payment is Successful. </p>"; html += "<p>The QR Code Image is attached along with the mail.</p>"; html += "<p>Event Name : " + ticketDetails.EventTitle; html += "<p>Venue Name : " + ticketDetails.VenueName; html += "<p>City : " + ticketDetails.City; html += "<p>State : " + ticketDetails.State; html += "<p>Ticket Number : " + ticketDetails.TicketNumber; html += "<p><br><br><strong>Thanks,The " + System.Configuration.ConfigurationManager.AppSettings["AppName"] + " Team</strong></p>"; //EmailHelper.SendEmail(email, System.Configuration.ConfigurationManager.AppSettings["AppName"] + " : QR Code", html); //#region "Send Mail Implementation" //MailMessage mail = new MailMessage(); //SmtpClient SmtpServer = new SmtpClient("smtp.sendgrid.net"); //string mailFrom = System.Configuration.ConfigurationManager.AppSettings["ADMIN_EMAIL"].ToString(); ////mail.From = new MailAddress("*****@*****.**"); //mail.From = new MailAddress(mailFrom); //mail.To.Add(email); //mail.Subject = "Ticketing Payment Confirmation"; //mail.Body = Server.HtmlDecode(html); //mail.Body = mail.Body.Replace("<p>", ""); //mail.Body = mail.Body.Replace("</p>", "\r\n"); //mail.Body = mail.Body.Replace("<br>", "\r"); //System.Net.Mail.Attachment attachment; //string filePath = Server.MapPath("/Content/QRCodeImages/" + img); //attachment = new System.Net.Mail.Attachment(filePath); //mail.Attachments.Add(attachment); //SmtpServer.Port = 587; // 25; //SmtpServer.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["ApiKey"], ConfigurationManager.AppSettings["ApiKeyPass"]); //SmtpServer.EnableSsl = true; ////SmtpServer.Send(mail); //#endregion //lblmessage.Text = "Payment Successfull"; Response.Write("<script language='javascript'>alert('Payment Successfull....');</script>"); //Response.Redirect("TicketEventCheckout.aspx"); } else { Response.Write("<script language='javascript'>alert('Payment Not Successfull....');</script>"); //lblmessage.Text = "Payment Not Successfull"; } } #region "Commented Code" //MailMessage mailMsg = new MailMessage(); //// To //mailMsg.To.Add(new MailAddress("*****@*****.**", "Shallu Dogra")); //// From //mailMsg.From = new MailAddress("*****@*****.**", "Mukesh Sagar"); //// Subject and multipart/alternative Body //mailMsg.Subject = "subject"; //string text = "text body"; //string htmlMail = @"<p>html body</p>"; //mailMsg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(text, null, MediaTypeNames.Text.Plain)); //mailMsg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(htmlMail, null, MediaTypeNames.Text.Html)); //// Init SmtpClient and send //SmtpClient smtpClient = new SmtpClient("smtp.sendgrid.net", Convert.ToInt32(587)); //System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("*****@*****.**", "admin@1234"); //smtpClient.Credentials = credentials; //smtpClient.Send(mailMsg); #endregion //lblmessage.Text = "Thanks for your payment."; //lblmessage.ForeColor = System.Drawing.Color.Green; } catch (Exception) { //Response.Write("Message : " + ee.Message); //Response.Write(ee.StackTrace); Response.Redirect("TicketEventCheckout.aspx", true); } }
public bool AuthenticateUser(TicketingUsers user) { Musika.Controllers.API.TicketingAPIController myController = new Musika.Controllers.API.TicketingAPIController(); myController.AuthenticateUser(user); return(true); }
public bool RegisterTicketingUser([System.Web.Http.FromBody] TicketingUsers users) { Musika.Controllers.API.TicketingAPIController myController = new Musika.Controllers.API.TicketingAPIController(); myController.RegisterTicketingUser(users); return(true); }