|
Wersja 65, 1.4 KB
(wprowadzona przez dorota, 17 years temu)
|
|
|
| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.ComponentModel;
|
|---|
| 4 | using System.Data;
|
|---|
| 5 | using System.Drawing;
|
|---|
| 6 | using System.Text;
|
|---|
| 7 | using System.Windows.Forms;
|
|---|
| 8 |
|
|---|
| 9 | namespace Baza_Reklam
|
|---|
| 10 | {
|
|---|
| 11 | public partial class AgencjaAddForm : Form
|
|---|
| 12 | {
|
|---|
| 13 | public AgencjaAddForm(int idAgencji)
|
|---|
| 14 | {
|
|---|
| 15 | InitializeComponent();
|
|---|
| 16 |
|
|---|
| 17 | this.aGENCJETableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
|
|---|
| 18 |
|
|---|
| 19 | if (idAgencji == 0)
|
|---|
| 20 | {
|
|---|
| 21 | DataView table = ( DataView)aGENCJEBindingSource.List;
|
|---|
| 22 | table.AddNew();
|
|---|
| 23 | }
|
|---|
| 24 | else
|
|---|
| 25 | {
|
|---|
| 26 | this.aGENCJETableAdapter.FillByIdAgencji(this.sLOWNIKDataSet.AGENCJE, idAgencji);
|
|---|
| 27 |
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | private void ZapiszButton_Click(object sender, EventArgs e)
|
|---|
| 32 | {
|
|---|
| 33 | if (symbolTextBox.Text == "")
|
|---|
| 34 | {
|
|---|
| 35 | MessageBox.Show("Wpisz symbol agencji");
|
|---|
| 36 | return;
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | this.aGENCJEBindingSource.EndEdit();
|
|---|
| 40 | this.aGENCJETableAdapter.Update(this.sLOWNIKDataSet.AGENCJE);
|
|---|
| 41 | MessageBox.Show("Zmiany zosta³y zapisane");
|
|---|
| 42 | this.Close();
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | private void AnulujButton_Click(object sender, EventArgs e)
|
|---|
| 46 | {
|
|---|
| 47 | this.Close();
|
|---|
| 48 | }
|
|---|
| 49 | }
|
|---|
| 50 | } |
|---|
Notatka: Zobacz
TracBrowser
aby uzyskać więcej informacji.