Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Отчёт по лабораторным.docx
Скачиваний:
3
Добавлен:
18.11.2022
Размер:
1.41 Mб
Скачать

InitializeComponent();

}

private void orderBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

this.Validate();

this.orderBindingSource.EndEdit();

this.tableAdapterManager.UpdateAll(this.sale1DataSet);

}

private void Form4_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "sale1DataSet.product". При необходимости она может быть перемещена или удалена.

this.productTableAdapter.Fill(this.sale1DataSet.product);

// TODO: данная строка кода позволяет загрузить данные в таблицу "sale1DataSet.client". При необходимости она может быть перемещена или удалена.

this.clientTableAdapter.Fill(this.sale1DataSet.client);

// TODO: данная строка кода позволяет загрузить данные в таблицу "sale1DataSet.order". При необходимости она может быть перемещена или удалена.

this.orderTableAdapter.Fill(this.sale1DataSet.order);

}

private void bindingNavigatorMoveFirstItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

}

private void bindingNavigatorMovePreviousItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

}

private void bindingNavigatorMoveNextItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

}

private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

}

private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = false;

}

}

}

private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)

{

foreach (Control ctl in this.Controls)

{

if (ctl is TextBox || ctl is Label || ctl is ComboBox || ctl is DateTimePicker)

{

ctl.Enabled = true;

}

}

}

private void Form4_Activated(object sender, EventArgs e)

{

this.productTableAdapter.Fill(this.sale1DataSet.product);

this.clientTableAdapter.Fill(this.sale1DataSet.client);

this.orderTableAdapter.Fill(this.sale1DataSet.order);

}

private void Form4_FormClosing(object sender, FormClosingEventArgs e)

{

DialogResult s;

this.Hide();

e.Cancel = true;

s = MessageBox.Show("Сохранить сделанные изменения в таблице заказы?", "Внимание !", MessageBoxButtons.OKCancel);

if (s == DialogResult.OK)

{

this.Validate();

this.orderBindingSource.EndEdit();

this.tableAdapterManager.UpdateAll(this.sale1DataSet);

}

}

}

}

Форма Компании:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace Проектирование_интерфейсов__11

{

public partial class Form5 : Form

{

public Form5()

{