Index: Baza Reklam 2 - Faktury/REKLAMADataSet.Designer.cs
===================================================================
--- Baza Reklam 2 - Faktury/REKLAMADataSet.Designer.cs (revision 4)
+++ Baza Reklam 2 - Faktury/REKLAMADataSet.Designer.cs (revision 7)
@@ -5882,4 +5882,6 @@
             private global::System.Data.DataColumn columnwyroznienie;
             
+            private global::System.Data.DataColumn columnreklamaId;
+            
             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
             public FAKTURA_DETAILSDataTable() {
@@ -6049,4 +6051,11 @@
                 get {
                     return this.columnwyroznienie;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn reklamaIdColumn {
+                get {
+                    return this.columnreklamaId;
                 }
             }
@@ -6100,5 +6109,6 @@
                         short TYP, 
                         short PODTYP, 
-                        bool wyroznienie) {
+                        bool wyroznienie, 
+                        int reklamaId) {
                 FAKTURA_DETAILSRow rowFAKTURA_DETAILSRow = ((FAKTURA_DETAILSRow)(this.NewRow()));
                 object[] columnValuesArray = new object[] {
@@ -6122,5 +6132,6 @@
                         TYP,
                         PODTYP,
-                        wyroznienie};
+                        wyroznienie,
+                        reklamaId};
                 if ((parentFAKTURYRowByFAKTURY_FAKTURA_DETAILS != null)) {
                     columnValuesArray[1] = parentFAKTURYRowByFAKTURY_FAKTURA_DETAILS[0];
@@ -6176,4 +6187,5 @@
                 this.columnPODTYP = base.Columns["PODTYP"];
                 this.columnwyroznienie = base.Columns["wyroznienie"];
+                this.columnreklamaId = base.Columns["reklamaId"];
             }
             
@@ -6224,4 +6236,6 @@
                 this.columnwyroznienie = new global::System.Data.DataColumn("wyroznienie", typeof(bool), null, global::System.Data.MappingType.Element);
                 base.Columns.Add(this.columnwyroznienie);
+                this.columnreklamaId = new global::System.Data.DataColumn("reklamaId", typeof(int), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnreklamaId);
                 this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
                                 this.columnID_FAKTURA_DETAILS}, true));
@@ -22302,4 +22316,19 @@
             
             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int reklamaId {
+                get {
+                    try {
+                        return ((int)(this[this.tableFAKTURA_DETAILS.reklamaIdColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'reklamaId\' in table \'FAKTURA_DETAILS\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableFAKTURA_DETAILS.reklamaIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
             public FAKTURYRow FAKTURYRow {
                 get {
@@ -22499,4 +22528,14 @@
             public void SetwyroznienieNull() {
                 this[this.tableFAKTURA_DETAILS.wyroznienieColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsreklamaIdNull() {
+                return this.IsNull(this.tableFAKTURA_DETAILS.reklamaIdColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetreklamaIdNull() {
+                this[this.tableFAKTURA_DETAILS.reklamaIdColumn] = global::System.Convert.DBNull;
             }
         }
@@ -33664,5 +33703,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -33717,4 +33756,13 @@
             this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
             this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@param1", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ReklamaId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[6].Connection = this.Connection;
+            this._commandCollection[6].CommandText = "UPDATE    [UKAŻE SIĘ W NR]\r\nSET              zafakturowana = @zafakturowana, idFa" +
+                "ktury = @idFaktury, netto = @netto\r\nWHERE     (ID = @Original_ID)";
+            this._commandCollection[6].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@zafakturowana", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 0, 0, "zafakturowana", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idFaktury", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idFaktury", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@netto", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 0, 0, "netto", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ID", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 0, "ID", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
         }
         
@@ -34024,4 +34072,40 @@
         public virtual int Update(int ReklamaId, short Nr_Wydania, short status, bool zafakturowana, global::System.Nullable<int> idFaktury, global::System.Nullable<global::System.DateTime> dataDodania, global::System.Nullable<global::System.DateTime> dataAnulowania, global::System.Nullable<double> netto, decimal Original_ID) {
             return this.Update(ReklamaId, Nr_Wydania, status, zafakturowana, idFaktury, dataDodania, dataAnulowania, netto, Original_ID, Original_ID);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)]
+        public virtual int UpdatePoUsunieciuFaktury(bool zafakturowana, global::System.Nullable<int> idFaktury, global::System.Nullable<float> netto, decimal Original_ID) {
+            global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6];
+            command.Parameters[0].Value = ((bool)(zafakturowana));
+            if ((idFaktury.HasValue == true)) {
+                command.Parameters[1].Value = ((int)(idFaktury.Value));
+            }
+            else {
+                command.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            if ((netto.HasValue == true)) {
+                command.Parameters[2].Value = ((float)(netto.Value));
+            }
+            else {
+                command.Parameters[2].Value = global::System.DBNull.Value;
+            }
+            command.Parameters[3].Value = ((decimal)(Original_ID));
+            global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
+            if (((command.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                command.Connection.Open();
+            }
+            int returnValue;
+            try {
+                returnValue = command.ExecuteNonQuery();
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    command.Connection.Close();
+                }
+            }
+            return returnValue;
         }
     }
@@ -37652,15 +37736,15 @@
             tableMapping.ColumnMappings.Add("PODTYP", "PODTYP");
             tableMapping.ColumnMappings.Add("wyroznienie", "wyroznienie");
+            tableMapping.ColumnMappings.Add("reklamaId", "reklamaId");
             this._adapter.TableMappings.Add(tableMapping);
             this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
             this._adapter.DeleteCommand.Connection = this.Connection;
-            this._adapter.DeleteCommand.CommandText = "DELETE FROM [FAKTURA_DETAILS] WHERE (([ID_FAKTURA_DETAILS] = @Original_ID_FAKTURA" +
-                "_DETAILS))";
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM FAKTURA_DETAILS\r\nWHERE     (ID_FAKTURY = @id_faktury)";
             this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
-            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ID_FAKTURA_DETAILS", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURA_DETAILS", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id_faktury", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
             this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
             this._adapter.InsertCommand.Connection = this.Connection;
-            this._adapter.InsertCommand.CommandText = @"INSERT INTO [FAKTURA_DETAILS] ([ID_FAKTURY], [ROK], [MIESIAC], [NAZWA_USLUGI], [SYMBOL_SWW], [JM], [ILOSC], [CENA_JEDN], [UPUST_PR], [UPUST_NETTO], [NETTO], [S_VAT], [VAT], [BRUTTO], [TYTUL], [NR_WYDANIA], [TYP], [PODTYP], [wyroznienie]) VALUES (@ID_FAKTURY, @ROK, @MIESIAC, @NAZWA_USLUGI, @SYMBOL_SWW, @JM, @ILOSC, @CENA_JEDN, @UPUST_PR, @UPUST_NETTO, @NETTO, @S_VAT, @VAT, @BRUTTO, @TYTUL, @NR_WYDANIA, @TYP, @PODTYP, @wyroznienie);
-SELECT ID_FAKTURA_DETAILS, ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie FROM FAKTURA_DETAILS WHERE (ID_FAKTURA_DETAILS = SCOPE_IDENTITY()) ORDER BY ROK, MIESIAC";
+            this._adapter.InsertCommand.CommandText = @"INSERT INTO [FAKTURA_DETAILS] ([ID_FAKTURY], [ROK], [MIESIAC], [NAZWA_USLUGI], [SYMBOL_SWW], [JM], [ILOSC], [CENA_JEDN], [UPUST_PR], [UPUST_NETTO], [NETTO], [S_VAT], [VAT], [BRUTTO], [TYTUL], [NR_WYDANIA], [TYP], [PODTYP], [wyroznienie], [reklamaId]) VALUES (@ID_FAKTURY, @ROK, @MIESIAC, @NAZWA_USLUGI, @SYMBOL_SWW, @JM, @ILOSC, @CENA_JEDN, @UPUST_PR, @UPUST_NETTO, @NETTO, @S_VAT, @VAT, @BRUTTO, @TYTUL, @NR_WYDANIA, @TYP, @PODTYP, @wyroznienie, @reklamaId);
+SELECT ID_FAKTURA_DETAILS, ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie, reklamaId FROM FAKTURA_DETAILS WHERE (ID_FAKTURA_DETAILS = SCOPE_IDENTITY()) ORDER BY ROK, MIESIAC";
             this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
             this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID_FAKTURY", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -37683,8 +37767,9 @@
             this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PODTYP", global::System.Data.SqlDbType.SmallInt, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PODTYP", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
             this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wyroznienie", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "wyroznienie", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@reklamaId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "reklamaId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
             this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
             this._adapter.UpdateCommand.Connection = this.Connection;
-            this._adapter.UpdateCommand.CommandText = @"UPDATE [FAKTURA_DETAILS] SET [ID_FAKTURY] = @ID_FAKTURY, [ROK] = @ROK, [MIESIAC] = @MIESIAC, [NAZWA_USLUGI] = @NAZWA_USLUGI, [SYMBOL_SWW] = @SYMBOL_SWW, [JM] = @JM, [ILOSC] = @ILOSC, [CENA_JEDN] = @CENA_JEDN, [UPUST_PR] = @UPUST_PR, [UPUST_NETTO] = @UPUST_NETTO, [NETTO] = @NETTO, [S_VAT] = @S_VAT, [VAT] = @VAT, [BRUTTO] = @BRUTTO, [TYTUL] = @TYTUL, [NR_WYDANIA] = @NR_WYDANIA, [TYP] = @TYP, [PODTYP] = @PODTYP, [wyroznienie] = @wyroznienie WHERE (([ID_FAKTURA_DETAILS] = @Original_ID_FAKTURA_DETAILS));
-SELECT ID_FAKTURA_DETAILS, ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie FROM FAKTURA_DETAILS WHERE (ID_FAKTURA_DETAILS = @ID_FAKTURA_DETAILS) ORDER BY ROK, MIESIAC";
+            this._adapter.UpdateCommand.CommandText = @"UPDATE [FAKTURA_DETAILS] SET [ID_FAKTURY] = @ID_FAKTURY, [ROK] = @ROK, [MIESIAC] = @MIESIAC, [NAZWA_USLUGI] = @NAZWA_USLUGI, [SYMBOL_SWW] = @SYMBOL_SWW, [JM] = @JM, [ILOSC] = @ILOSC, [CENA_JEDN] = @CENA_JEDN, [UPUST_PR] = @UPUST_PR, [UPUST_NETTO] = @UPUST_NETTO, [NETTO] = @NETTO, [S_VAT] = @S_VAT, [VAT] = @VAT, [BRUTTO] = @BRUTTO, [TYTUL] = @TYTUL, [NR_WYDANIA] = @NR_WYDANIA, [TYP] = @TYP, [PODTYP] = @PODTYP, [wyroznienie] = @wyroznienie, [reklamaId] = @reklamaId WHERE (([ID_FAKTURA_DETAILS] = @Original_ID_FAKTURA_DETAILS));
+SELECT ID_FAKTURA_DETAILS, ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie, reklamaId FROM FAKTURA_DETAILS WHERE (ID_FAKTURA_DETAILS = @ID_FAKTURA_DETAILS) ORDER BY ROK, MIESIAC";
             this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID_FAKTURY", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -37707,4 +37792,5 @@
             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PODTYP", global::System.Data.SqlDbType.SmallInt, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PODTYP", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wyroznienie", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "wyroznienie", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@reklamaId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "reklamaId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ID_FAKTURA_DETAILS", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURA_DETAILS", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID_FAKTURA_DETAILS", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURA_DETAILS", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -37719,9 +37805,9 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
             this._commandCollection[0].CommandText = @"SELECT     ID_FAKTURA_DETAILS, ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, 
-                      S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie
+                      S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie, reklamaId
 FROM         FAKTURA_DETAILS
 ORDER BY ROK, MIESIAC";
@@ -37729,11 +37815,16 @@
             this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[1].Connection = this.Connection;
-            this._commandCollection[1].CommandText = @"SELECT     BRUTTO, CENA_JEDN, ID_FAKTURA_DETAILS, ID_FAKTURY, ILOSC, JM, MIESIAC, NAZWA_USLUGI, NETTO, NR_WYDANIA, PODTYP, ROK, 
-                      SYMBOL_SWW, S_VAT, TYP, TYTUL, UPUST_NETTO, UPUST_PR, VAT, wyroznienie
+            this._commandCollection[1].CommandText = "DELETE FROM [FAKTURA_DETAILS] WHERE (id_faktury = @id_faktury)";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id_faktury", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = @"SELECT     BRUTTO, CENA_JEDN, ID_FAKTURA_DETAILS, ID_FAKTURY, ILOSC, JM, MIESIAC, NAZWA_USLUGI, NETTO, NR_WYDANIA, PODTYP, ROK, 
+                      SYMBOL_SWW, S_VAT, TYP, TYTUL, UPUST_NETTO, UPUST_PR, VAT, wyroznienie, reklamaId
 FROM         FAKTURA_DETAILS
 WHERE     (ID_FAKTURY = @param)
 ORDER BY ROK, MIESIAC";
-            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
-            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@param", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@param", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_FAKTURY", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -37764,5 +37855,5 @@
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
         public virtual int FillByIDFaktury(REKLAMADataSet.FAKTURA_DETAILSDataTable dataTable, global::System.Nullable<int> param) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             if ((param.HasValue == true)) {
                 this.Adapter.SelectCommand.Parameters[0].Value = ((int)(param.Value));
@@ -37782,5 +37873,5 @@
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
         public virtual REKLAMADataSet.FAKTURA_DETAILSDataTable GetDataByIDFaktury(global::System.Nullable<int> param) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             if ((param.HasValue == true)) {
                 this.Adapter.SelectCommand.Parameters[0].Value = ((int)(param.Value));
@@ -37822,6 +37913,11 @@
         [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
-        public virtual int Delete(int Original_ID_FAKTURA_DETAILS) {
-            this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID_FAKTURA_DETAILS));
+        public virtual int Delete(global::System.Nullable<int> id_faktury) {
+            if ((id_faktury.HasValue == true)) {
+                this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(id_faktury.Value));
+            }
+            else {
+                this.Adapter.DeleteCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
             global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
             if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
@@ -37862,5 +37958,6 @@
                     global::System.Nullable<short> TYP, 
                     global::System.Nullable<short> PODTYP, 
-                    global::System.Nullable<bool> wyroznienie) {
+                    global::System.Nullable<bool> wyroznienie, 
+                    global::System.Nullable<int> reklamaId) {
             if ((ID_FAKTURY.HasValue == true)) {
                 this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ID_FAKTURY.Value));
@@ -37976,4 +38073,10 @@
             else {
                 this.Adapter.InsertCommand.Parameters[18].Value = global::System.DBNull.Value;
+            }
+            if ((reklamaId.HasValue == true)) {
+                this.Adapter.InsertCommand.Parameters[19].Value = ((int)(reklamaId.Value));
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[19].Value = global::System.DBNull.Value;
             }
             global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
@@ -38016,4 +38119,5 @@
                     global::System.Nullable<short> PODTYP, 
                     global::System.Nullable<bool> wyroznienie, 
+                    global::System.Nullable<int> reklamaId, 
                     int Original_ID_FAKTURA_DETAILS, 
                     int ID_FAKTURA_DETAILS) {
@@ -38132,6 +38236,12 @@
                 this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value;
             }
-            this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(Original_ID_FAKTURA_DETAILS));
-            this.Adapter.UpdateCommand.Parameters[20].Value = ((int)(ID_FAKTURA_DETAILS));
+            if ((reklamaId.HasValue == true)) {
+                this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(reklamaId.Value));
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[19].Value = global::System.DBNull.Value;
+            }
+            this.Adapter.UpdateCommand.Parameters[20].Value = ((int)(Original_ID_FAKTURA_DETAILS));
+            this.Adapter.UpdateCommand.Parameters[21].Value = ((int)(ID_FAKTURA_DETAILS));
             global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
             if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
@@ -38173,6 +38283,35 @@
                     global::System.Nullable<short> PODTYP, 
                     global::System.Nullable<bool> wyroznienie, 
+                    global::System.Nullable<int> reklamaId, 
                     int Original_ID_FAKTURA_DETAILS) {
-            return this.Update(ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie, Original_ID_FAKTURA_DETAILS, Original_ID_FAKTURA_DETAILS);
+            return this.Update(ID_FAKTURY, ROK, MIESIAC, NAZWA_USLUGI, SYMBOL_SWW, JM, ILOSC, CENA_JEDN, UPUST_PR, UPUST_NETTO, NETTO, S_VAT, VAT, BRUTTO, TYTUL, NR_WYDANIA, TYP, PODTYP, wyroznienie, reklamaId, Original_ID_FAKTURA_DETAILS, Original_ID_FAKTURA_DETAILS);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, false)]
+        public virtual int DeleteByIdFaktury(global::System.Nullable<int> id_faktury) {
+            global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1];
+            if ((id_faktury.HasValue == true)) {
+                command.Parameters[0].Value = ((int)(id_faktury.Value));
+            }
+            else {
+                command.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
+            if (((command.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                command.Connection.Open();
+            }
+            int returnValue;
+            try {
+                returnValue = command.ExecuteNonQuery();
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    command.Connection.Close();
+                }
+            }
+            return returnValue;
         }
     }
