root/trunk/BazaZamowien/Premie/UserAddFormPremie.cs @ 900

Wersja 710, 2.0 KB (wprowadzona przez dorota, 18 years temu)

baza zamowien i premii 1.0.0.1

Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8using BazaZamowien.Classes;
9using BazaZamowien.PREMIEDataSetTableAdapters;
10
11namespace BazaZamowien
12{
13    public partial class UserAddFormPremie : Form
14    {
15        GrupyTableAdapter grupyTableAdapter = new GrupyTableAdapter();
16
17        public UserAddFormPremie(int id)
18        {
19            InitializeComponent();
20
21            grupyTableAdapter.Connection.ConnectionString = ConnString.getConnString().PremieConnStr;
22            usersTableAdapter.Connection.ConnectionString = ConnString.getConnString().PremieConnStr;
23
24            interface_Pracownicy2TableAdapter.Connection.ConnectionString = ConnString.getConnString().PremieConnStr;
25            this.interface_Pracownicy2TableAdapter.Fill(this.pREMIEDataSet.Interface_Pracownicy2);
26
27            iDEGrupaComboBox.DataSource = grupyTableAdapter.GetData();
28            iDEGrupaComboBox.DisplayMember = "NazwaGrupy";
29            iDEGrupaComboBox.ValueMember = "IDE";
30           
31            if (id == 0)
32            {
33                DataView table = (DataView)usersBindingSource.List;
34                DataRowView row = table.AddNew();
35
36                usersBindingSource.MoveLast();
37                usersBindingSource.EndEdit();
38            }
39            else
40            {
41                usersTableAdapter.FillByIDEPracownik(this.pREMIEDataSet.Users, id);
42            }         
43        }
44 
45        private void anulujButton_Click(object sender, EventArgs e)
46        {
47            this.Close();
48        }
49
50        private void zapiszButton_Click(object sender, EventArgs e)
51        {
52            this.usersBindingSource.EndEdit();
53            this.usersTableAdapter.Update(this.pREMIEDataSet.Users);
54            MessageBox.Show("Zmiany zosta³y zapisane");
55            this.DialogResult = DialogResult.OK;           
56        }
57
58    }
59}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.