| 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 PaymentForm2 : Form
|
|---|
| 12 | {
|
|---|
| 13 | private int idWplaty;
|
|---|
| 14 |
|
|---|
| 15 | public int IdWplaty
|
|---|
| 16 | {
|
|---|
| 17 | get { return idWplaty; }
|
|---|
| 18 | set { idWplaty = value; }
|
|---|
| 19 | }
|
|---|
| 20 | private int idFaktury;
|
|---|
| 21 |
|
|---|
| 22 | public PaymentForm2(int idWplaty, int idFaktury)
|
|---|
| 23 | {
|
|---|
| 24 | this.idWplaty = idWplaty;
|
|---|
| 25 | this.idFaktury = idFaktury;
|
|---|
| 26 | InitializeComponent();
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | private void PaymentForm_Load(object sender, EventArgs e)
|
|---|
| 30 | {
|
|---|
| 31 |
|
|---|
| 32 | this.rEKLAMADataSet.Wplaty.Constraints.Remove("FAKTURY_Wplaty");
|
|---|
| 33 |
|
|---|
| 34 | wplatyTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
|
|---|
| 35 | VIEW_ZESTAWIENIE_FAKTUR_NOWETableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
|
|---|
| 36 |
|
|---|
| 37 | this.VIEW_ZESTAWIENIE_FAKTUR_NOWETableAdapter.FillByIdFaktury(this.rEKLAMADataSet.VIEW_ZESTAWIENIE_FAKTUR_NOWE, idFaktury);
|
|---|
| 38 |
|
|---|
| 39 | if (idWplaty == 0)
|
|---|
| 40 | {
|
|---|
| 41 | DataRowView row = (DataRowView)wplatyBindingSource.AddNew();
|
|---|
| 42 | row["idFaktury"] = idFaktury;
|
|---|
| 43 | row["idZamowienia"] = this.rEKLAMADataSet.VIEW_ZESTAWIENIE_FAKTUR_NOWE[0].idZamowienia;
|
|---|
| 44 | wplatyBindingSource.EndEdit();
|
|---|
| 45 | }
|
|---|
| 46 | else
|
|---|
| 47 | {
|
|---|
| 48 | wplatyTableAdapter.FillByIdWplaty(this.rEKLAMADataSet.Wplaty, idWplaty);
|
|---|
| 49 | }
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | private void dodajButton_Click(object sender, EventArgs e)
|
|---|
| 53 | {
|
|---|
| 54 | /*
|
|---|
| 55 | if ((sYMBOL_POTWIERDZENIATextBox.Text == "") | (rODZAJ_POTWIERDZENIAComboBox.SelectedIndex == -1))
|
|---|
| 56 | {
|
|---|
| 57 | MessageBox.Show("Uzupe³nij wszystkie pola");
|
|---|
| 58 | return;
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | this.Validate();
|
|---|
| 62 |
|
|---|
| 63 | this.wplatyBindingSource.EndEdit();
|
|---|
| 64 | this.wplatyTableAdapter.Update(this.rEKLAMADataSet.Wplaty);
|
|---|
| 65 | this.idWplaty = rEKLAMADataSet.Wplaty[0].idWplaty;
|
|---|
| 66 | */
|
|---|
| 67 | this.DialogResult = DialogResult.OK;
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | private void anulujButton_Click(object sender, EventArgs e)
|
|---|
| 71 | {
|
|---|
| 72 | this.DialogResult = DialogResult.Cancel;
|
|---|
| 73 | }
|
|---|
| 74 | }
|
|---|
| 75 | } |
|---|