private bool SendOTP()
        {
            bool msgSent = false;

            try
            {
                var randomNumber = RandomNumber(10000, 99999);
                var user         = new EverythingFootballDemo.DAL.User();
                user = (EverythingFootballDemo.DAL.User)Session["userInfo"];
                var msgBody  = "Your OTP for the transaction on The Offside Club is " + randomNumber.ToString();
                var toNumber = "+1" + (user.PhoneNumber).ToString();

                var client = new Client("hemanthvaddireddy", "T75TkBTd9SV62mledlizx8JJfssRvl");
                var link   = client.SendMessage(msgBody, toNumber);
                if (link.Success)
                {
                    msgSent = true;
                }
                else
                {
                    msgSent = false;
                }
            }
            catch (Exception e)
            {
                if (e.Message != null)
                {
                    msgSent = false;
                }
            }
            return(msgSent);
        }
Ejemplo n.º 2
0
        protected void chkSaveCreditCardInfo_CheckedChanged(object sender, EventArgs e)
        {
            var chkUseExistingCreditCard = sender as CheckBox;

            if (chkSaveCreditCardInfo.Checked)
            {
                if (Session["userInfo"] != null)
                {
                    var user = new EverythingFootballDemo.DAL.User();
                    user = (EverythingFootballDemo.DAL.User)Session["userInfo"];
                    txtCreditCardNum.Text      = user.CreditCardNumber.ToString();
                    txtNameOnCard.Text         = user.NameOnCard.ToString();
                    txtSecCode.Text            = user.SecurityCode.ToString();
                    ddlMonth.SelectedItem.Text = user.CCExpMonth.ToString();
                    ddlYear.SelectedItem.Text  = user.CCExpYear.ToString();

                    tblCreditCard.Enabled = false;
                }
            }
            else
            {
                txtCreditCardNum.Text  = string.Empty;
                txtNameOnCard.Text     = string.Empty;
                txtSecCode.Text        = string.Empty;
                ddlMonth.SelectedValue = "0";
                ddlYear.SelectedValue  = "2018";
            }
        }
Ejemplo n.º 3
0
 private void populateUserInfo()
 {
     if (Session["userInfo"] != null)
     {
         var user = new EverythingFootballDemo.DAL.User();
         user = (EverythingFootballDemo.DAL.User)Session["userInfo"];
     }
 }
        private void sendEmail()
        {
            var user = new EverythingFootballDemo.DAL.User();

            user = (EverythingFootballDemo.DAL.User)Session["userInfo"];
            string     strFrom = ConfigurationManager.AppSettings["SenderEmail"].ToString();
            var        mailMsg = new MailMessage(strFrom, user.EmailID);
            Attachment attachment;

            attachment = new System.Net.Mail.Attachment(@"D:\Images\Ticket.pdf");
            mailMsg.Attachments.Add(attachment);
            mailMsg.Body    = "Congratulations. Your ticket has been generated succesfully";
            mailMsg.Subject = "Ticket Booking Confirmation - The Offside Club";

            SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);

            smtp.Credentials = new System.Net.NetworkCredential()
            {
                UserName = ConfigurationManager.AppSettings["UserName"].ToString(),
                Password = ConfigurationManager.AppSettings["Password"].ToString()
            };
            smtp.EnableSsl = true;
            smtp.Send(mailMsg);
        }
Ejemplo n.º 5
0
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            var user = new EverythingFootballDemo.DAL.User();

            user.UserName         = txtUserName.Text;
            user.Password         = txtPassword.Text;
            user.EmailID          = txtEmailAddress.Text;
            user.CreditCardNumber = Convert.ToInt64(txtCreditCardNum.Text);
            user.SecurityCode     = Convert.ToInt16(txtSecCode.Text);
            user.NameOnCard       = txtNameOnCard.Text;
            user.CCExpMonth       = ddlMonth.SelectedItem.Text;
            user.CCExpYear        = ddlYear.SelectedValue;
            user.PhoneNumber      = Convert.ToInt64(txtPhoneNumber.Text);
            var isUserValid = ValidateUserDetails(user);

            if (isUserValid)
            {
                var usersBLL = new EverythingFootballDemo.BLL.Users();
                var isUserCreatedSuccessfully = usersBLL.SaveUser(user);
                if (isUserCreatedSuccessfully)
                {
                    Session["userInfo"]      = user;
                    divRegister.Visible      = false;
                    divStatus.Visible        = true;
                    lblStatusMsg.Text        = "Congratulations. You have successfully joined The Offside Club.";
                    hlnkHomePage.NavigateUrl = "HomePage.aspx?UserReg=Y";
                }
                else
                {
                    divRegister.Visible      = false;
                    divStatus.Visible        = true;
                    lblStatusMsg.Text        = "Sorry. We are unable to process your request. Please try later.";
                    hlnkHomePage.NavigateUrl = "HomePage.aspx?UserReg=N";
                }
            }
        }