Пример #1
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            if (Request.Cookies["oid"] != null)
            {
                order_id = long.Parse(Request.Cookies["oid"].Value);
            }

            CMEDLunar lunar = new CMEDLunar
            {
                order_id = order_id,
                bmonth = BMonth.SelectedValue,
                bday = BDay.SelectedValue,
                byear = BYear.SelectedValue,
                bhour = BHour.SelectedValue,
                bmin = BMin.SelectedValue,
                ampm = AMPM.SelectedValue,
                bcity = BCity.Text,
                bstate = BState.Text,
                bcountry = BCountry.Text,
                fname = FName.Text,
                lname = LName.Text,
                gender = Gender.SelectedValue,

            };
            var ret_order_id = controller.SaveLunar(lunar);

            //send email to Philip about a new relationship (names and email and order number) please visit the admin page for relationship details.
            Util.SendAstrologicalEmail(lunar);
            Response.Redirect("/Astrological_Thankyou.aspx");
        }
Пример #2
0
        public long SaveLunar(CMEDLunar lunar)
        {
            DB db = new DB();

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

            cmd.Parameters.AddWithValue("@ordernum", lunar.order_id);
            cmd.Parameters.AddWithValue("@bmonth", lunar.bmonth);
            cmd.Parameters.AddWithValue("@bday", lunar.bday);
            cmd.Parameters.AddWithValue("@byear", lunar.byear);
            cmd.Parameters.AddWithValue("@bhour", lunar.bhour);
            cmd.Parameters.AddWithValue("@bmin", lunar.bmin);
            cmd.Parameters.AddWithValue("@ampm", lunar.ampm);
            cmd.Parameters.AddWithValue("@bcity", lunar.bcity);
            cmd.Parameters.AddWithValue("@bstate", lunar.bstate);
            cmd.Parameters.AddWithValue("@bcountry", lunar.bcountry);
            cmd.Parameters.AddWithValue("@fname", lunar.fname);
            cmd.Parameters.AddWithValue("@lname", lunar.lname);
            cmd.Parameters.AddWithValue("@gender", lunar.gender);

            DataTable dt = db.Execute(cmd);

            DataRow row = dt.Rows[0];

            return long.Parse(row["order_id"].ToString());
        }