// GET: Admin/TicketingEventDetail
        public ActionResult Index(Int32 EventID)
        {
            ViewBag.eventid = EventID;
            DataSet data;
            string  count = "";

            data = new Musika.Repository.SPRepository.SpRepository().GetTempEventByEventId(EventID);
            if (data.Tables[0].Rows.Count > 0)
            {
                count = data.Tables[0].Rows[0][0].ToString();
            }
            else
            {
                count = data.Tables[0].Rows[0][0].ToString();
            }
            ViewBag.isapproval = count;
            return(View());
        }
示例#2
0
        public void Approve()
        {
            DataSet ds;
            DataSet ds1;

            Models.TicketingEventsNew _Events = null;
            int EventID = Convert.ToInt32(Request.QueryString["ID"]);

            if (EventID > 0)
            {
                ds = new Musika.Repository.SPRepository.SpRepository().ShiftDatetoOriginalTables(EventID);
                GenericRepository <TicketingEventsNew> _EventsRepo = new GenericRepository <TicketingEventsNew>(_unitOfWork);
                _Events = _EventsRepo.Repository.GetById(EventID);

                bool tourdata = new Musika.Repository.SPRepository.SpRepository().SpUpdateTourData(_Events.ArtistId, _Events.VenueName, _Events.StartDate, _Events.EventTitle, _Events.EventID);
                // if (ds.Tables[0].Rows.Count > 0)
                //  {
                ds1 = new Musika.Repository.SPRepository.SpRepository().SpGetTicketingEventUsersToSendEmail(EventID);
                if (ds1.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds1.Tables[0].Rows[0];
                    ltMessage.Text = "Event Approved successfully.";
                    string html  = string.Empty;
                    string Email = dr["Email"].ToString();
                    html  = "<p>Hi " + dr["UserName"].ToString() + "," + " </p>";
                    html += "<p>Your Event Changes Has been approved by Admin." + "</p>";
                    html += "<p><br>You can view your changes in your panel" + "<p>";
                    //  html += "<p><br>User Name : " + dr["UserName"].ToString() + "<p>";
                    html += "<p><br><br><strong>Thanks,<br><br>The " + WebConfigurationManager.AppSettings["AppName"] + " Team</strong></p>";
                    SendEmailHelper.SendMail(Email, "Event Changes Approved", html, "");
                }
                // }
                else
                {
                    ltMessage.Text = "Invalid Activation code.";
                }
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataSet ds;

            if (!this.IsPostBack)
            {
                string activationCode = !string.IsNullOrEmpty(Request.QueryString["ActivationCode"]) ? Request.QueryString["ActivationCode"] : Guid.Empty.ToString();
                ds = new Musika.Repository.SPRepository.SpRepository().UpdateUserActivationStatus(activationCode);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    ltMessage.Text = "Activation successful.";

                    #region "Mail for Activation"

                    #region "Mail To Admin"
                    // Mail To admin

                    string html = string.Empty;

                    html  = "<p>Hi Administrator," + "</p>";
                    html += "<p>A new user is added in Musika application." + "</p>";
                    html += "<p><br>The details of the user is as follows :" + "<p>";
                    html += "<p><br>User Name : " + dr["UserName"].ToString() + "<p>";
                    html += "<p><br><br><strong>Thanks,<br><br>The " + WebConfigurationManager.AppSettings["AppName"] + " Team</strong></p>";

                    SendEmailHelper.SendMail(System.Configuration.ConfigurationManager.AppSettings["ADMIN_EMAIL"].ToString(), "New Musika User Registration", html, "");
                    #endregion

                    //#region "Mail To Event Organizer"
                    //// Mail To admin

                    string AdminEmail = System.Configuration.ConfigurationManager.AppSettings["ADMIN_EMAIL"].ToString();

                    html = string.Empty;

                    html  = "<p>Hi " + dr["Email"].ToString() + "," + "</p>";
                    html += "<p>Thanks for using " + WebConfigurationManager.AppSettings["AppName"] + "! </p>";
                    html += "<p>Thanks for Registering on Musika Application." + "</p>";
                    html += "<p><br>As per registration your details are as follows :" + "<p>";
                    html += "<p><br>User Name : " + dr["UserName"].ToString() + "<p>";
                    html += "<p><br><br><strong>Thanks,<br><br>The " + WebConfigurationManager.AppSettings["AppName"] + " Team</strong></p>";

                    //#region "Send Mail Implementation"
                    SendEmailHelper.SendMail(dr["Email"].ToString(), "New Musika User Registration", html, "");
                    //#endregion
                    #endregion
                }
                else
                {
                    ltMessage.Text = "Invalid Activation code.";
                }
                #region "Unused Code"
                //string constr = @"Data Source=23.111.138.246,2728; Initial Catalog=Musika;App=Musika; User ID=sa; Password=sdsol99!;";
                //string activationCode = !string.IsNullOrEmpty(Request.QueryString["ActivationCode"]) ? Request.QueryString["ActivationCode"] : Guid.Empty.ToString();
                //using (SqlConnection con = new SqlConnection(constr))
                //{
                //    using (SqlCommand cmd = new SqlCommand("DELETE FROM UserActivation WHERE ActivationCode = @ActivationCode"))
                //    {
                //        using (SqlDataAdapter sda = new SqlDataAdapter())
                //        {
                //            cmd.CommandType = CommandType.Text;
                //            cmd.Parameters.AddWithValue("@ActivationCode", activationCode);
                //            cmd.Connection = con;
                //            con.Open();
                //            int rowsAffected = cmd.ExecuteNonQuery();
                //            con.Close();

                //        }
                //    }
                //}
                #endregion
            }
        }
        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);
            }
        }