private void button5_Click(object sender, EventArgs e) { int resvID = 0; DialogResult dd = MessageBox.Show("결제 하시겠습니까?", "트와이스 나연 호텔", MessageBoxButtons.YesNo); if (dd == DialogResult.Yes) { frmPayment frm_pay = new frmPayment(); DialogResult rr = frm_pay.ShowDialog(this); if (rr == DialogResult.OK) { String Query; sql_con = new SQLiteConnection("Data Source=" + dbPath); sql_cmd.CommandText = "select * from reservation"; sql_cmd.Connection = sql_con; sql_cmd.Connection.Open(); DB = sql_cmd.ExecuteReader(); while (DB.Read()) { resvID = Convert.ToInt16(DB["id"]); } resvID++; DB.Close(); Query = "Insert into reservation (id, roomID, sdate, edate, userID) VALUES (" + resvID.ToString() + ",1,'" + dateTimePicker1.Value.Date.ToString() + "','" + dateTimePicker2.Value.Date.ToString() + "','" + Passvalue + "');"; sql_cmd.CommandText = Query; sql_cmd.ExecuteNonQuery(); sql_cmd.Connection.Close(); button5.Enabled = false; button5.Text = "예약불가"; pictureBox6.Select(); } } }
private void button4_Click(object sender, EventArgs e) { int resvID = 0; DialogResult dd = MessageBox.Show("결제 하시겠습니까?", "트와이스 나연 호텔", MessageBoxButtons.YesNo); if (dd == DialogResult.Yes) { frmPayment frm_pay = new frmPayment(); DialogResult rr = frm_pay.ShowDialog(this); if (rr == DialogResult.OK) { String Query; sql_con = new SQLiteConnection("Data Source=" + dbPath); sql_cmd.CommandText = "select * from reservation"; sql_cmd.Connection = sql_con; sql_cmd.Connection.Open(); DB = sql_cmd.ExecuteReader(); while (DB.Read()) { resvID = Convert.ToInt16(DB["id"]); } resvID++; DB.Close(); Query = "Insert into reservation (id, roomID, sdate, edate, userID) VALUES (" + resvID.ToString() + ",0,'" + dateTimePicker1.Value.Date.ToString() + "','" + dateTimePicker2.Value.Date.ToString() + "','" + Passvalue + "');"; sql_cmd.CommandText = Query; sql_cmd.ExecuteNonQuery(); sql_cmd.Connection.Close(); button4.Enabled = false; button4.Text = "예약불가"; //MailMessage mail = new MailMessage("*****@*****.**", "*****@*****.**"); //SmtpClient client = new SmtpClient(); //client.Port = 25; //client.DeliveryMethod = SmtpDeliveryMethod.Network; //client.UseDefaultCredentials = false; //client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "a1s2d3f4f"); //client.Host = "mail.google.com"; //mail.Subject = "this is a test email."; //mail.Body = "this is my test email body"; //client.Send(mail); pictureBox6.Select(); } } }