Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

laba3

.pdf
Скачиваний:
2
Добавлен:
26.11.2022
Размер:
656.82 Кб
Скачать

11

Приложение В

Листинг FormSotrudnik

using System;

using System.Windows.Forms;

namespace BAZA

{

public partial class FormSotrudnik : Form

{

public FormSotrudnik()

{

InitializeComponent();

}

private void сотрудник_комиссииBindingNavigatorSaveItem_Click(object sender, EventArgs

e)

{

this.Validate(); this.сотрудник_комиссииBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.vUZDataSet);

}

private void FormSotrudnik_Load(object sender, EventArgs e)

{

this.сотрудник_комиссииTableAdapter.Fill(this.vUZDataSet.Сотрудник_комиссии);

}

}

}

12

Приложение Г

Листинг FormSpecialnosti

using System;

using System.Windows.Forms;

namespace BAZA

{

public partial class FormSpecialnosti : Form

{

public FormSpecialnosti()

{

InitializeComponent();

}

private void специальностиBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

this.Validate(); this.специальностиBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.vUZDataSet);

}

private void FormSpecialnosti_Load(object sender, EventArgs e)

{

this.специальностиTableAdapter.Fill(this.vUZDataSet.Специальности);

}

string GetSelectedFieldName()

{

return

специальностиDataGridView.Columns[специальностиDataGridView.CurrentCell.ColumnIndex ].DataPropertyName;

}

private void toolStripButtonFind_Click(object sender, EventArgs e)

{

if (toolStripTextBoxFind.Text == "")

{

MessageBox.Show("Вы ничего не задали", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information); return;

}

int indexPos; try

{

indexPos = специальностиBindingSource.Find(GetSelectedFieldName(), toolStripTextBoxFind.Text);

}

catch (Exception err)

{

MessageBox.Show("Ошибка поиска \n" + err.Message); return;

}

if (indexPos > -1) специальностиBindingSource.Position = indexPos;

13

else

{

MessageBox.Show("Таких данных нет", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information); специальностиBindingSource.Position = 0;

}

}

private void checkBoxFind_CheckedChanged(object sender, EventArgs e)

{

if (checkBoxFind.Checked)

{

if (toolStripTextBoxFind.Text == "") MessageBox.Show("Вы ничего не задали", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);

else try

{

специальностиBindingSource.Filter =

GetSelectedFieldName() + "='" + toolStripTextBoxFind.Text + "'";

}

catch (Exception err)

{

MessageBox.Show("Ошибка фильтрации \n" + err.Message);

}

}

else

специальностиBindingSource.Filter = ""; if (специальностиBindingSource.Count == 0)

{

MessageBox.Show("Нет таких данных"); специальностиBindingSource.Filter = ""; checkBoxFind.Checked = false;

}

}

}

}

14

Приложение Д

Листинг FormSpisok

using System;

using System.Windows.Forms;

namespace BAZA

{

public partial class FormSpisok : Form

{

public FormSpisok()

{

InitializeComponent();

}

private void конкурсный_списокBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

this.Validate(); this.конкурсный_списокBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.vUZDataSet);

}

private void FormSpisok_Load(object sender, EventArgs e)

{

this.конкурсный_списокTableAdapter.Fill(this.vUZDataSet.Конкурсный_список);

}

}

}

15

Приложение Е

Листинг FormVUZ1

using System;

using System.Windows.Forms;

namespace BAZA

{

public partial class FormVUZ1 : Form

{

public FormVUZ1()

{

InitializeComponent();

}

private void вУЗBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

this.Validate(); this.вУЗBindingSource.EndEdit();

this.tableAdapterManager.UpdateAll(this.vUZDataSet);

}

private void FormVUZ1_Load(object sender, EventArgs e)

{

this.вУЗTableAdapter.Fill(this.vUZDataSet.ВУЗ);

}

}

}

16

Приложение Ё

Листинг KonkursniySpisok

using System;

using System.Windows.Forms;

namespace BAZA

{

public partial class KonkursniySpisok : Form

{

public KonkursniySpisok()

{

InitializeComponent();

}

private void конкурсный_списокBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

this.Validate(); this.конкурсный_списокBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.vUZDataSet);

}

private void KonkursniySpisok_Load(object sender, EventArgs e)

{

this.абитуриентTableAdapter.Fill(this.vUZDataSet.абитуриент); this.конкурсный_списокTableAdapter.Fill(this.vUZDataSet.Конкурсный_список);

}

private void button1_Click(object sender, EventArgs e)

{

FormAbiturient fa = new FormAbiturient(); fa.Show();

}

}

}

Соседние файлы в предмете Безопасность систем баз данных