当前位置:首页 > vs2008c#和sql server 2005影院管理系统3 - 图文
附件A 沈阳工业大学实验报告
(适用计算机程序设计类)
实验步骤或程序:
? 进入管理员界面,选择影片管理,添加影片信息(addmovie.cs) ? 当未输入影片名称时
填写影片名称:天龙八部
? 若当未输入影片主要演员时(如下)
填写主要演员:林志颖,刘涛 ? 当未填写票价的时候
选择类型:动作
放映时间2015年01月02日 放映时间:选择17:00 放映厅号:二号放映厅 票价:80
? 显示结果
? 代码:
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.Odbc; using System.Drawing; using System.Linq; using System.Text;
using System.Windows.Forms; namespace s {
public partial class addmovie : Form {
public static OdbcConnection odbcconn = null; public addmovie() {
InitializeComponent(); }
private void addmovie_Load(object sender, EventArgs e)
{ }
private void button1_Click(object sender, EventArgs e) //确定按钮 {
String constr = \ odbcconn = new OdbcConnection(constr); odbcconn.Open(); string kind = \影片类型 //string nianji = \适用年级 // string str = \
if (textBox1.Text == \还没有填写影片名称!\ if (textBox3.Text == \还没有填写主要演员!\ if (textBox5.Text == \还没有填写影片票价!\
// if (comboBox1.SelectedItem.ToString() == \{ MessageBox.Show(\请填写完全影片信息!\return; }
//if (comboBox2.SelectedItem.ToString() == \{ MessageBox.Show(\请填写完全影片信息!\return; }
//if (comboBox3.SelectedItem.ToString() == \{ MessageBox.Show(\请填写完全影片信息!\return; }
//if (comboBox4.SelectedItem.ToString() == \{ MessageBox.Show(\请填写完全影片信息!\return; }
if (radioButton1.Checked == true) {
kind = \喜剧\ }
else if (radioButton2.Checked == true) {
kind = \动作\ }
else if (radioButton3.Checked == true) {
kind = \爱情\ }
else if (radioButton4.Checked == true) { kind = \战争\
else { MessageBox.Show(\还没有选择影片类型!\
string selectstr = \into movie(name,kind,person,day,number,sale,time,seat) values('\+ textBox1.Text + \+ kind + \+ textBox3.Text + \+ comboBox2.Text.ToString() + comboBox3.SelectedItem.ToString() //str
=
+
comboBox4.SelectedItem.ToString()
\
into
+
\
+ movie values
comboBox1.SelectedItem.ToString() + \ + \(movie_name,movie_kind,movie_person,movie_day,movie_number,movie_sale) ( '\ // str = str + textBox1.Text + \
// str = str + textBox2.Text + \ // str = str + comboBox1.SelectedItem.ToString() + \
共分享92篇相关文档