using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace 专科医院门诊系统_眼科_
{
public partial class 主界面 : Form
{
OleDbDataAdapter adapter;
DataTable table = new DataTable();
string str = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\design\vc\project\专科医院门诊系统(眼科)\db1.accdb";
OleDbConnection con = new OleDbConnection();
public 主界面()
{
InitializeComponent();
button1.Click += new EventHandler(button1_Click);
button2.Click += new EventHandler(button2_Click);
}
private void textbox1_TextChanged(object sender, EventArgs e)
{
}
private void textbox2_TextChanged(object sender, EventArgs e)
{
}
private void radioButton1_Checked(object sender, EventArgs e)
{
}
private void radioButton2_Checked(object sender, EventArgs e)
{
}
private void radioButton3_Checked(object sender, EventArgs e)
{
}
private void radioButton4_Checked(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textbox1.Text != "" && textbox2.Text != "")
{
string sql = "select * from user where ID=" + textbox1.Text + " and [password]='" + textbox2.Text + "'";
adapter = new OleDbDataAdapter(sql, str);
OleDbCommandBuilder buider = new OleDbCommandBuilder(adapter);
adapter.InsertCommand = buider.GetInsertCommand();
table.Clear();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
Form f3 = new Form3();
f3.Show();
this.Hide();
}
else
{
MessageBox.Show("用户名或密码不能空");
}
}
if (radioButton1.Checked == true)
{
this.Hide();
new 医生调取就诊号界面().ShowDialog();
}
else if (radioButton2.Checked == true)
{
this.Hide();
new 挂号缴费选择界面().ShowDialog();
}
else if (radioButton3.Checked == true)
{
this.Hide();
new 药房人员调取就诊号界面().ShowDialog();
}
else if (radioButton4.Checked == true)
{
this.Hide();
new 医导查询界面().ShowDialog();
}
}
private void button2_Click(object sender, EventArgs e)
{
textbox1.Text = textbox2.Text = string.Empty;
}
private void 主界面_Load(object sender, EventArgs e)
{
}
}
}