Мультиагентная обучающая система по медицинской диагностике

label20.Visible = false;

label21.Visible = false;

label31.Visible = false;

label22.Visible = false;

//--

label23.Visible = false;

label24.Visible = false;

label25.Visible = false;

label26.Visible = false;

label27.Visible = false;

label28.Visible = false;

label29.Visible = false;

label32.Visible = false;

label30.Visible = false;

}

priva

te void exit_Click(object sender, EventArgs e)

{

Application.Exit();

}

private void tema_Click(object sender, EventArgs e)

{

//lb.Text = "tema!";

}

private void reg_Click(object sender, EventArgs e)

{

//lb.Visible = true;

//lb.Text = "reg!";

//search.Visible = true;

//add.Visible = true;

//delete.Visible = true;

Form2 form2 = new Form2();

//Application.EnableVisualStyles();

//Application.SetCompatibleTextRenderingDefault(false);

form2.Show();

}

private void search_Click(object sender, EventArgs e)

{

button25.Visible = false;

listBox5.Visible = false;

button22.Visible = false;

button20.Visible = true;

button21.Visible = true;

button11.Visible = false;

//tabControl.TabPages[1].Hide();

button5.Visible = false;

button1.Enabled = false;

label8.Visible = false;

label7.Text = "Заполните все необходимые поля для поиска";

label1.Visible = false;

label2.Visible = false;

label3.Visible = false;

label4.Visible = false;

label5.Visible = false;

label6.Visible = false;

button1.Visible = false;

textBox1.Visible = false;

textBox2.Visible = false;

textBox3.Visible = false;

textBox4.Visible = false;

textBox5.Visible = false;

textBox6.Visible = false;

button3.Visible = false;

button4.Visible = false;

button2.Visible = false;

textBox7.Visible = false;

textBox1.Text = "";

textBox2.Text = "";

textBox3.Text = "";

textBox4.Text = "";

textBox5.Text = "";

textBox6.Text = "";

label8.Visible = false;

textBox7.Visible = false;

}

private void button1_Click(object sender, EventArgs e)

{

String str;

str = "";

int pr;

pr = 0;

if (textBox1.Text == "")

{

str += "0;";

pr++;

}

else str += textBox1.Text+";";

if (textBox2.Text == "")

{

str += "'_';";

pr++;

}

else str += "'"+textBox2.Text + "';";

if (textBox3.Text == "")

{

str += "'_';";

pr++;

}

else str += "'" + textBox3.Text + "';";

if (textBox4.Text == "")

{

str += "'_';";

pr++;

}

else str += "'" + textBox4.Text + "';";

if (textBox5.Text == "")

{

str += "0;";

pr++;

}

else str += textBox5.Text + ";";

if (textBox6.Text == "")

{

str += "0";

pr++;

}

else str += textBox6.Text;

if (pr == 6) MessageBox.Show("Введите хотя бы одно поле для поиска");

else

{

StreamWriter sw2 = new StreamWriter(new FileStream("COMMAND.TXT", FileMode.Create), Encoding.GetEncoding(866));

sw2.Write("'search';");

sw2.Close();

StreamWriter sw1 = new StreamWriter(new FileStream("INSEARCH.TXT", FileMode.Create), Encoding.GetEncoding(866));

sw1.Write(str);

sw1.Close();

Process myProcess = Process.Start("A06.EXE");

myProcess.WaitForExit();

FileStream fin;

string l;

fin = new FileStream("OUTSEARC.TXT", FileMode.Open);

StreamReader fstr_in = new StreamReader(fin, Encoding.GetEncoding(866));

l = fstr_in.ReadLine();

fstr_in.Close();

if (l == "no students")

{

label7.ForeColor = System.Drawing.Color.Red;

label7.Text = "Поиск не дал результатов!";

}

else // поиск успешный

{

button22.Visible = true;

button1.Visible = false;

label8.Visible = false;

textBox7.Visible = false;

label7.ForeColor = System.Drawing.Color.Blue;

label7.Text = "Поиск успешный.";

mas = l.Split(';');

//--

textBox1.Text = mas[1];

textBox2.Text = mas[2];

textBox3.Text = mas[3];

textBox4.Text = mas[4];

textBox5.Text = mas[5];

textBox6.Text = mas[6];

button3.Visible = true;

button4.Visible = true;

//button2.Visible = false;

//textBox7.Visible = false;

}

}

}

//ОБРАБОТЧИК КНОПКИ "Изменить данные"

private void button3_Click(object sender, EventArgs e)

{

button1.Visible = false;

button22.Visible = false;

label7.Text = "Измените необходимые поля";

label8.Visible = true;

textBox7.Visible = true;

button2.Visible = true;

button4.Visible = false;

button3.Visible = false;

button11.Visible = false;

}

//ОБРАБОТЧИК КНОПКИ "Изменить"

private void button2_Click(object sender, EventArgs e)

{

if (textBox7.Text == mas[11])

{

StreamWriter sw1 = new StreamWriter(new FileStream("COMMAND.TXT", FileMode.Create), Encoding.GetEncoding(866));

sw1.Write("'edit';");

sw1.Close();

StreamWriter sw2 = new StreamWriter(new FileStream("INEDIT.TXT", FileMode.Create), Encoding.GetEncoding(866));

sw2.Write(mas[0] + "\r\n");

sw2.Write(textBox1.Text + ";" + "'" + textBox2.Text + "';'" + textBox3.Text + "';'" + textBox4.Text + "';" + textBox5.Text + ";" + textBox6.Text + ";'" + mas[7] + "';'" + mas[8] + "';" + mas[9] + ";" + mas[10] + ";'" + mas[11] + "'");

sw2.Close();

Process myProcess = Process.Start("A06.EXE");

myProcess.WaitForExit();

label7.ForeColor = System.Drawing.Color.Blue;

label7.Text = "Изменения сохранены.";

label8.Visible = false;

textBox7.Visible = false;

button2.Visible = false;

button4.Visible = true;

button3.Visible = true;

button22.Visible = true;

}

else

{

label7.ForeColor = System.Drawing.Color.Red;

label7.Text = "Ошибка: не верный пароль. Введите Ваш пароль заново.";

}

textBox7.Text = "";

}

private void add_Click(object sender, EventArgs e)

{

textBox7.Text = "";

button24.Visible = false;

button25.Visible = false;

button22.Visible = false;

button24.Visible = false;

listBox5.Visible = false;

button20.Visible = false;

button21.Visible = false;

button11.Visible = false;

textBox1.Text = "";

textBox2.Text = "";

textBox3.Text = "";

textBox4.Text = "";

textBox5.Text = "";

textBox6.Text = "";

Страница:  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 
 16  17  18  19  20  21  22  23  24  25  26  27  28  29  30 
 31  32  33  34  35  36  37  38  39  40  41  42  43  44  45 
 46  47  48 


Другие рефераты на тему «Педагогика»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы