コード例 #1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        obj.executequery("insert into user_orders values('" + count1 + "','" + lbl_name.Text + "','" + lbl_phn.Text + "','" + lbl_email.Text + "','" + lbl_address.Text + "','" + lbl_renu.Text + "','"
                         + lbl_re.Text + "','" + lbl_room_type.Text + "','" + lbl_guest.Text + "','" + lbl_food_item.Text + "','" + lbl_food_price.Text + "','" + lbl_totprice.Text + "')");

        Response.Redirect("payment.aspx");
    }
コード例 #2
0
    private void bookroom()
    {
        int    guest       = int.Parse(ddl_adult.SelectedItem.Text) + int.Parse(ddl_adult.SelectedItem.Text);
        string total_guest = guest.ToString();


        Session["cust_email"]     = txt_email.Text;
        Session["cust_mobile"]    = txt_mobile.Text;
        Session["cust_address"]   = txt_address.Text;
        Session["custm_name"]     = txt_name.Text;
        Session["cust_room_type"] = ddl.Text;
        Session["cust_guest"]     = total_guest;

        if (ddl_adult.SelectedItem.Text == "1")
        {
            adult = 400;
        }
        else if (ddl_adult.SelectedItem.Text == "2")
        {
            adult = 600;
        }
        else if (ddl_adult.SelectedItem.Text == "3")
        {
            adult = 800;
        }
        else if (ddl_adult.SelectedItem.Text == "4")
        {
            adult = 1000;
        }


        if (ddl_children.SelectedItem.Text == "1")
        {
            child = 300;
        }
        else if (ddl_children.SelectedItem.Text == "2")
        {
            child = 600;
        }


        total_bill = Convert.ToInt32(Label10.Text) + adult + child;

        tax = Convert.ToInt32(total_bill * 18) / 100;

        total_bill += (int)tax;

        obj.executequery("insert into user_room values('" + txt_name.Text + "','" + txt_dob.Text + "','" + radio_gender.Text + "','" + txt_mobile.Text + "','" + txt_email.Text + "','"
                         + txt_address.Text + "','" + ddl_state.Text + "','" + ddl_adult.Text + "','" + ddl_children.Text + "','" + ddl.Text + "','"
                         + ddl_floor.Text + "','" + txt_entrydate.Text + "','" + txt_entry_time.Text + "','" + txt_depdate.Text + "','" + txt_dept_time.Text + "','" + total_bill + "')");


        Session["total_bill"] = total_bill.ToString();
        Session["room_tax"]   = tax.ToString();

        Session["cust_food_price"] = "N/A";
    }
コード例 #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string email = txt_subsr.Text;

        con = new SqlConnection(constr);
        con.Open();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select email from user_subsr where email ='" + txt_subsr.Text + "'";
        cmd.Connection  = con;
        SqlDataReader rd = cmd.ExecuteReader();

        if (rd.HasRows)
        {
            txt_subsr.Text = "";
            Label1.Text    = "Your Email is already subscribed with us";
        }
        else
        {
            obj.executequery("insert into user_subsr values('" + txt_subsr.Text + "')");


            using (MailMessage mail = new MailMessage())
            {
                mail.From = new MailAddress("*****@*****.**");
                mail.To.Add(email);
                mail.Subject    = "Glenn Manor";
                mail.Body       = "You have Successfully registered to Glenn Manor";
                mail.IsBodyHtml = true;
                using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587))
                {
                    smtp.UseDefaultCredentials = false;

                    smtp.Credentials    = new System.Net.NetworkCredential("*****@*****.**", "R0N@!D9027292272");
                    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                    smtp.EnableSsl      = true;
                    smtp.Send(mail);
                }
            }

            Label1.Text    = "Your Email is subscribed with us now";
            txt_subsr.Text = "";
        }
    }
コード例 #4
0
    protected void btn_signUp_Click(object sender, EventArgs e)
    {
        con = new SqlConnection(constr);
        con.Open();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from user_cred where email ='" + txt_email.Text + "'or mobile='" + txt_mobile.Text + "' ";
        cmd.Connection  = con;
        SqlDataReader rd = cmd.ExecuteReader();

        if (rd.HasRows)
        {
            Label4.Text = "Please Check the Email or Mobile No Again";
        }
        else
        {
            obj.executequery("insert into user_cred values('" + ddl_gender.Text + "','" + txt_name.Text + "','" + txt_mobile.Text + "','" + txt_address.Text + "','" + txt_email.Text + "','" + txt_password.Text + "')");
            RegisterStartupScript("s", "<script>alert('Waoo you've successfully registered to Glenn Manor...')</script>");

            Response.Redirect("home.aspx");
        }
    }
コード例 #5
0
    protected void Book_Click(object sender, EventArgs e)
    {
        con = new SqlConnection(constr);
        con.Open();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from user_cred where mobile ='" + txt_mobile.Text + "' ";
        cmd.Connection  = con;
        SqlDataReader rd = cmd.ExecuteReader();

        if (rd.HasRows)
        {
            obj.executequery("insert into user_event values('" + txt_name.Text + "','" + txt_mobile.Text + "','" + ddl_event.Text + "','" + txt_start_date.Text + "','" + txt_end_date.Text + "','"
                             + txt_time_start.Text + "','" + txt_time_end.Text + "','" + txt_no_of_guest.Text + "','" + bill + "')");

            Response.Redirect("payment.aspx");
            RegisterStartupScript("s", "<script>alert('Your Event is Successfully booked...')</script>");
        }
        else
        {
            RegisterStartupScript("s", "<script>alert('Register or Login First...')</script>");
        }
    }