Beispiel #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CMEDCustomer customer = new CMEDCustomer
            {
                first_name = txtFirstName.Text,
                last_name = txtLastName.Text,
                phone_number = txtPhoneNumber.Text,
                email = lblEmail.Text,
                password = txtPassword.Text,
                opt_in = chkOPtin.Checked
            };

            if (controller.SaveCMEDRegisterCustomer(customer))
            {

                Util.DisplayAlert(this, "Your profile has been saved successfully, you will now be redirect to your products page");
                var redirectPage = System.Configuration.ConfigurationManager.AppSettings["ProductPage"].ToString();
                FormsAuthentication.SignOut();
                Util.RegisterStartupScript(this, redirectPage);

            }
            else
            {
                lblErrMessage.Text = "profile update failed, please try again later";
            }
        }
Beispiel #2
0
        public bool SaveCMEDRegisterCustomer(CMEDCustomer customer)
        {
            DB db = new DB();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "SaveCMEDRegisterCustomer";

            cmd.Parameters.AddWithValue("@first_name", customer.first_name);
            cmd.Parameters.AddWithValue("@last_name", customer.last_name);
            cmd.Parameters.AddWithValue("@phone_number", customer.phone_number);
            cmd.Parameters.AddWithValue("@Email", customer.email);
            cmd.Parameters.AddWithValue("@Password", customer.password);
            cmd.Parameters.AddWithValue("@opt_in", customer.opt_in);

            db.Execute(cmd);

            return true;
        }
Beispiel #3
0
        public CMEDCustomer GetCMEDCustomerById(long customer_id)
        {
            DB db = new DB();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetCMEDCustomerById";
            cmd.Parameters.AddWithValue("@customer_id", customer_id);

            DataTable dt = db.Execute(cmd);

            DataRow dr = dt.Rows[0];

            CMEDCustomer login = new CMEDCustomer
            {
                customer_id = long.Parse(dr["customer_id"].ToString()),
                email = dr["email"].ToString(),
                first_name = dr["first_name"].ToString(),
                last_name = dr["last_name"].ToString(),
                password = dr["password"].ToString(),
                password_reminder = dr["password_reminder"].ToString(),
                customer_type = dr["customer_type"].ToString(),
                phone_number = dr["phone_number"].ToString(),
                opt_in = Boolean.Parse(dr["opt_in"].ToString()),
                active = Boolean.Parse(dr["active"].ToString()),
                date_created = DateTime.Parse(dr["date_created"].ToString()),
                created_by = dr["created_by"].ToString(),
                date_updated = DateTime.Parse(dr["date_updated"].ToString()),
                updated_by = dr["updated_by"].ToString(),

            };

            return login;
        }
Beispiel #4
0
    public static void SendRecoverPasswordMail(CMEDCustomer customer)
    {
        var InfoEmail = System.Configuration.ConfigurationManager.AppSettings["InfoEmail"];
        var CustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["CustServiceEmail"];

        var TestInfoEmail = System.Configuration.ConfigurationManager.AppSettings["TestInfoEmail"];
        var TestCustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["TestCustServiceEmail"];

        var sb = new StringBuilder();
        sb.Append("Hello ").Append(customer.first_name).Append(" ").AppendLine(customer.last_name);
        sb.AppendLine();
        sb.AppendLine();

        if (customer.password.Length > 0)
        {
            sb.Append("Your password to myss.com is: " + customer.password);
        }
        else
        {
            sb.Append("Please use the following link to reset your password: "******"http://media.myss.com/ResetPassword.aspx?id=" + customer.customer_id.ToString());
            sb.AppendLine();

        }

        sb.AppendLine();
        sb.AppendLine();
        sb.Append("Thank you for using Myss.com,");
        sb.AppendLine();
        sb.AppendLine("Regard, ");
        sb.AppendLine("Myss.com customer service.");

        var isTest = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestMode"]);
        var IsTestEmailDelivery = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestEmailDelivery"]);

        var TestString = String.Empty;
        if (isTest)
        {
            TestString = " - Testing Please Ignore";
        }

        if (IsTestEmailDelivery)
        {
            SendMail(customer.email, TestCustServiceEmail, "Myss.com Password Recovery" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, TestCustServiceEmail, "Myss.com Password Recovery" + TestString, sb.ToString(), false);

        }
        else
        {
            SendMail(customer.email, CustServiceEmail, "Myss.com Password Recovery" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, CustServiceEmail, "Myss.com Password Recovery" + TestString, sb.ToString(), false);

        }
    }
Beispiel #5
0
    public static void SendCMEDWelcomeMail(CMEDCustomer customer)
    {
        var InfoEmail = System.Configuration.ConfigurationManager.AppSettings["InfoEmail"];
        var CustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["CustServiceEmail"];

        var TestInfoEmail = System.Configuration.ConfigurationManager.AppSettings["TestInfoEmail"];
        var TestCustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["TestCustServiceEmail"];

        var sb = new StringBuilder();
        sb.Append("Hello ").Append(customer.first_name).Append(" ").AppendLine(customer.last_name);
        sb.AppendLine();
        sb.Append("Welcome to Caroline Myss community and thank you for registering with us.");

        sb.AppendLine();
        sb.AppendLine();
        sb.Append("You can access your account at: " + "http://media.myss.com/StudentLogin.aspx");
        sb.AppendLine();
        sb.AppendLine();
        sb.Append("You can view/purchase and download our webstreams (videos/audios) at: " + "http://myss.com/CMED/learning/");
        sb.AppendLine();
        sb.AppendLine();
        sb.Append("You can access/purchase our salons at: " + "http://myss.com/CMED/learning/salon.asp");
        sb.AppendLine();
        sb.AppendLine();
        sb.Append("You can purchase our CMED webinars at: " + "http://www.myss.com/CMED/workshops/Reflections/");
        sb.AppendLine();
        sb.AppendLine();

        sb.AppendLine();
        sb.AppendLine();
        sb.Append("Thank you for using Myss.com,");
        sb.AppendLine();
        sb.AppendLine("Regard, ");
        sb.AppendLine("Myss.com customer service.");

        var isTest = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestMode"]);
        var IsTestEmailDelivery = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestEmailDelivery"]);

        var TestString = String.Empty;
        if (isTest)
        {
            TestString = " - Testing Please Ignore";
        }

        if (IsTestEmailDelivery)
        {
            SendMail(customer.email, TestCustServiceEmail, "Welcome to Myss.com" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, TestCustServiceEmail, "Welcome to Myss.com" + TestString, sb.ToString(), false);

        }
        else
        {
            SendMail(customer.email, CustServiceEmail, "Welcome to Myss.com" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, CustServiceEmail, "Welcome to Myss.com" + TestString, sb.ToString(), false);

        }
    }
Beispiel #6
0
    public static void SendCMEDChangeEmail(CMEDCustomer customer)
    {
        var InfoEmail = System.Configuration.ConfigurationManager.AppSettings["InfoEmail"];
        var CustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["CustServiceEmail"];

        var TestInfoEmail = System.Configuration.ConfigurationManager.AppSettings["TestInfoEmail"];
        var TestCustServiceEmail = System.Configuration.ConfigurationManager.AppSettings["TestCustServiceEmail"];

        var sb = new StringBuilder();
        sb.Append("Hello ").Append(customer.first_name).Append(" ").AppendLine(customer.last_name);
        sb.AppendLine();
        sb.Append("You have requested to change your email at myss.com, below are the changes: ");

        sb.AppendLine();
        sb.AppendLine();
        sb.Append("New Email Address: " + customer.email);
        sb.AppendLine();
        sb.AppendLine();
        sb.Append("Your Password: "******"Thank you for using Myss.com,");
        sb.AppendLine();
        sb.AppendLine("Regard, ");
        sb.AppendLine("Myss.com customer service.");

        var isTest = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestMode"]);
        var IsTestEmailDelivery = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsTestEmailDelivery"]);

        var TestString = String.Empty;
        if (isTest)
        {
            TestString = " - Testing Please Ignore";
        }

        if (IsTestEmailDelivery)
        {
            SendMail(customer.email, TestCustServiceEmail, "Myss.com Email Change Confirmation" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, TestCustServiceEmail, "Myss.com Email Change Confirmation" + TestString, sb.ToString(), false);

        }
        else
        {
            SendMail(customer.email, CustServiceEmail, "Myss.com Email Change Confirmation" + TestString, sb.ToString(), false);
            SendMail(InfoEmail, CustServiceEmail, "Myss.com Email Change Confirmation" + TestString, sb.ToString(), false);

        }
    }