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

            CMEDRelationship relationship = new CMEDRelationship {
                  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,
                  bmonth2 = BMonth2.SelectedValue,
                  bday2 = BDay2.SelectedValue,
                  byear2 = BYear2.SelectedValue,
                  bhour2 = BHour2.SelectedValue,
                  bmin2 = BMin2.SelectedValue,
                  ampm2 = AMPM2.SelectedValue,
                  bcity2 = BCity2.Text,
                  bstate2 = BState2.Text,
                  bcountry2 = BCountry2.Text,
                  fname2 = FName2.Text,
                  lname2 = LName2.Text,
                  gender2 = Gender2.SelectedValue
            };
            var ret_order_id = controller.SaveRelationShip(relationship);

            //send email to Philip about a new relationship (names and email and order number) please visit the admin page for relationship details.
            Util.SendAstrologicalEmail(relationship);
            Response.Redirect("/Astrological_Thankyou.aspx");
        }
Example #2
0
        public long SaveRelationShip(CMEDRelationship relationship)
        {
            DB db = new DB();

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

            cmd.Parameters.AddWithValue("@ordernum", relationship.order_id);
            cmd.Parameters.AddWithValue("@bmonth", relationship.bmonth);
            cmd.Parameters.AddWithValue("@bday", relationship.bday);
            cmd.Parameters.AddWithValue("@byear", relationship.byear);
            cmd.Parameters.AddWithValue("@bhour", relationship.bhour);
            cmd.Parameters.AddWithValue("@bmin", relationship.bmin);
            cmd.Parameters.AddWithValue("@ampm", relationship.ampm);
            cmd.Parameters.AddWithValue("@bcity", relationship.bcity);
            cmd.Parameters.AddWithValue("@bstate", relationship.bstate);
            cmd.Parameters.AddWithValue("@bcountry", relationship.bcountry);
            cmd.Parameters.AddWithValue("@fname", relationship.fname);
            cmd.Parameters.AddWithValue("@lname", relationship.lname);
            cmd.Parameters.AddWithValue("@gender", relationship.gender);
            cmd.Parameters.AddWithValue("@bmonth2", relationship.bmonth);
            cmd.Parameters.AddWithValue("@bday2", relationship.bday);
            cmd.Parameters.AddWithValue("@byear2", relationship.byear);
            cmd.Parameters.AddWithValue("@bhour2", relationship.bhour);
            cmd.Parameters.AddWithValue("@bmin2", relationship.bmin);
            cmd.Parameters.AddWithValue("@ampm2", relationship.ampm);
            cmd.Parameters.AddWithValue("@bcity2", relationship.bcity);
            cmd.Parameters.AddWithValue("@bstate2", relationship.bstate);
            cmd.Parameters.AddWithValue("@bcountry2", relationship.bcountry);
            cmd.Parameters.AddWithValue("@fname2", relationship.fname);
            cmd.Parameters.AddWithValue("@lname2", relationship.lname);
            cmd.Parameters.AddWithValue("@gender2", relationship.gender2);

            DataTable dt = db.Execute(cmd);

            DataRow row = dt.Rows[0];

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