using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace KTV前台
{
public partial class 包场模式 : Form
{
public 包场模式()
{
InitializeComponent();
}
SqlConnection conn = new SqlConnection("server=.;database=ktv;integrated security=true;");
private void 选择包间_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("请输入房间号!", "提示");
}
else
{
conn.Open();
if (comboBox3.Text == "上午场(8:00---12:00)")
{
SqlCommand a = new SqlCommand("Select * from 房间信息 where 房间ID='"+textBox1.Text +"'",conn);
a.ExecuteNonQuery();
SqlCommand com = new SqlCommand("insert into 房间信息(模式,小时数,总价) values('" + comboBox3.Text + "','4','300') ", conn);
com.ExecuteNonQuery();
MessageBox.Show("添加成功", "提示");
}
else if (comboBox3.Text == "下午场(12:30---5:30)")
{
SqlCommand com = new SqlCommand("insert into 房间信息(模式,小时数,总价)values('" + comboBox3.Text + "','5','400')", conn);
com.ExecuteNonQuery();
MessageBox.Show("添加成功", "提示");
}
else if (comboBox3.Text == "黄金场(7:00---12:00)")
{
SqlCommand com = new SqlCommand("insert into 房间信息(房间ID,模式,小时数,总价) values('" + textBox1.Text + "','" + comboBox3.Text + "','5','1000')", conn);
com.ExecuteNonQuery();
MessageBox.Show("添加成功", "提示");
}
else if (comboBox3.Text == "午夜场(12:30--5:00)")
{
SqlCommand com = new SqlCommand("insert into 房间信息(房间ID,模式,小时数,总价) values('" + textBox1.Text + "','" + comboBox3.Text + "','5','300')", conn);
com.ExecuteNonQuery();
MessageBox.Show("添加成功", "提示");
}
conn.Close();
}
}
}
}