1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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 Brovi07.session1
- {
- public partial class newTovarForm : Form
- {
- public newTovarForm()
- {
- InitializeComponent();
- }
- private void productBindingNavigatorSaveItem_Click(object sender, EventArgs e)
- {
- this.Validate();
- this.productBindingSource.EndEdit();
- this.tableAdapterManager.UpdateAll(this.broviDataSet);
- }
- private void newTovarForm_Load(object sender, EventArgs e)
- {
- // TODO: данная строка кода позволяет загрузить данные в таблицу "broviDataSet.Product". При необходимости она может быть перемещена или удалена.
- this.productTableAdapter.Fill(this.broviDataSet.Product);
- }
- private void firstButton_Click(object sender, EventArgs e)
- {
- productBindingSource.MoveFirst();
- }
- private void lastButton_Click(object sender, EventArgs e)
- {
- productBindingSource.MoveLast();
- }
- private void prevButton_Click(object sender, EventArgs e)
- {
- productBindingSource.MovePrevious();
- }
- private void nextButton_Click(object sender, EventArgs e)
- {
- productBindingSource.MoveNext();
- }
- private void saveButtton_Click(object sender, EventArgs e)
- {
- MessageBoxButtons mb = MessageBoxButtons.YesNo;
- String message = "Вы действительно хотите сохранить данные?";
- String caption = "Выход";
- if (MessageBox.Show(message, caption, mb) == DialogResult.Yes)
- {
- this.Validate();
- this.productBindingSource.EndEdit();
- this.tableAdapterManager.UpdateAll(this.broviDataSet);
- }
- }
- private void delButton_Click(object sender, EventArgs e)
- {
- MessageBoxButtons mb = MessageBoxButtons.YesNo;
- String message = "Вы действительно хотите удалить данные?";
- String caption = "Выход";
- if (MessageBox.Show(message, caption, mb) == DialogResult.Yes)
- productBindingSource.RemoveCurrent();
- }
- private void addButton_Click(object sender, EventArgs e)
- {
- productBindingSource.AddNew();
- }
- private void exitButton_Click(object sender, EventArgs e)
- {
- this.Close();
- editTovarForm form = new editTovarForm();
- form.Show();
- }
- }
- }
|