using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Data; using System.ComponentModel; using System.Diagnostics; using System.Windows.Input; using System.Windows; using Haftmittel.Database; using Haftmittel.Database.DataSetListaTableAdapters; using Haftmittel.Database.DataSetListaSkladnikowTableAdapters; using System.Runtime.CompilerServices; namespace Haftmittel { public class ClassHaftmittel : INotifyPropertyChanged, IDataErrorInfo, IChangeTracking { private ObservableCollection _skladniki = new ObservableCollection(); private int _towar = -1; private int _openumer = -1; private readonly string connstr = string.Empty; public ObservableCollection Skladniki { get { return _skladniki; } set { _skladniki = value; } } private DataSetLista.ListaRow aktualny; public ClassHaftmittel(int towar, int openumer, string connstr) { _towar = towar; _openumer = openumer; this.connstr = connstr; _zapiszCommand = new DelegateCommand ( (s) => { zapisz(); _zapiszCommand.RaiseCanExecuteChanged(); }, (s) => { return IsChanged; } ); using (var _taH = new haftmittel_ListaSkladnikowTableAdapter() { ClearBeforeFill = true }) { var _dtH = new DataSetListaSkladnikow.haftmittel_ListaSkladnikowDataTable(); _taH.Connection.ConnectionString = connstr; try { _taH.Fill(_dtH); } catch (Exception ex) { MessageBox.Show(string.Format("Problem z tabelą {0}.", _dtH.TableName)); } // comboBoxy ze składnikami foreach (DataSetListaSkladnikow.haftmittel_ListaSkladnikowRow s in _dtH) { Skladniki.Add(new ClassSkladnik() { Id = s.Id, Kod = s.Kod, Nazwa = s.Nazwa }); } } wczytaj(towar); foreach (Skladnik s in Inhaltsstoffe) { s.PropertyChanged += _propertyChanged; } SDS_Obrazek1.PropertyChanged += _propertyChanged; SDS_Obrazek2.PropertyChanged += _propertyChanged; SDS_Obrazek3.PropertyChanged += _propertyChanged; SDS_Obrazek4.PropertyChanged += _propertyChanged; SDS_Obrazek5.PropertyChanged += _propertyChanged; SDS_Obrazek6.PropertyChanged += _propertyChanged; SDS_Obrazek7.PropertyChanged += _propertyChanged; SDS_Obrazek8.PropertyChanged += _propertyChanged; SDS_Obrazek9.PropertyChanged += _propertyChanged; SDS_Obrazek10.PropertyChanged += _propertyChanged; } private void _propertyChanged(object sender, PropertyChangedEventArgs e) { OnPropertyChanged("IsChanged"); OnPropertyChanged("SDS_Text_auto"); _zapiszCommand.RaiseCanExecuteChanged(); } private List czyscHistorie(List h) { List czysta = new List(); if (h.Count() > 2) { string temp = h.FirstOrDefault().wartosc.Trim(); czysta.Add(h.FirstOrDefault()); foreach(Historia hi in h) { if (hi.wartosc.Trim() != temp) { temp = hi.wartosc.Trim(); czysta.Add(hi); } } } return czysta; } /// /// dla historii włączania obrazków /// /// /// Tak/Nie private string boolToStr(bool b) => b ? "Tak" : "Nie"; private string nazwaObrazka(int id) { switch (id) { case 1: return "ostra toksyczność"; case 2: return "ostra toksyczność kat. 4, Działanie uczulające dla skóry i drażniące"; case 3: return "wybuchowe"; case 4: return "palne"; case 5: return "sprężone gazy"; case 6: return "uczulające (układ oddechowy) Toksyczność układowa na narządy docelowe (kat 1 i 2)"; case 8: return "utleniające"; case 9: return "żrące"; case 10: return "niebezpieczne dla środowiska"; default: return string.Empty; } } private void zapisz() { using (var _taL = new ListaTableAdapter() { ClearBeforeFill = true }) { _taL.Connection.ConnectionString = connstr; DataSetLista.ListaDataTable _dtL = new DataSetLista.ListaDataTable(); DataSetLista.ListaRow _r = _dtL.NewListaRow(); _r.hml_TwrTyp = 16; _r.hml_TwrNumer = _towar; _r.hml_OpeNumer = _openumer; _r.hml_DataPowstania = DateTime.Now; _r.hml_Herstellort = Herstellort; _r.hml_SDStext = SDS_Text; _r.hml_SDS1 = SDS_Obrazek1.Widoczny; _r.hml_SDS2 = SDS_Obrazek2.Widoczny; _r.hml_SDS3 = SDS_Obrazek3.Widoczny; _r.hml_SDS4 = SDS_Obrazek4.Widoczny; _r.hml_SDS5 = SDS_Obrazek5.Widoczny; _r.hml_SDS6 = SDS_Obrazek6.Widoczny; _r.hml_SDS7 = SDS_Obrazek7.Widoczny; _r.hml_SDS8 = SDS_Obrazek8.Widoczny; _r.hml_SDS9 = SDS_Obrazek9.Widoczny; _r.hml_SDS10 = SDS_Obrazek10.Widoczny; _r.hml_Schichten = Schichten; _r.hml_Eigenschaften = Eigenschaften; _r.hml_Anleitung = Anleitung; _r.hml_FS_od = FS_od; _r.hml_FS_do = FS_do; _r.hml_Dichte = Dichte; _r.hml_Dichte_do = Dichte_do; _r.hml_Viskositat_od = Viskositat_od; _r.hml_Viskositat_do = Viskositat_do; _r.hml_Farbe = Farbe; _r.hml_Verdunnung = Verdunnung; _r.hml_Schichtdicke_od = Schichtdicke_od; _r.hml_Schichtdicke_do = Schichtdicke_do; _r.hml_Leistung = Leistung_nach_Beschichtung; _r.hml_Lagerkapazitat = Lagerkapazitat; _r.hml_Verarbeitung = Verarbeitung; _r.hml_Inh0_Id = Inhaltsstoffe[0].Id; _r.hml_Inh0_Procent = Inhaltsstoffe[0].Procent; _r.hml_Inh0_ProcentDo = Inhaltsstoffe[0].ProcentDo; _r.hml_Inh1_Id = Inhaltsstoffe[1].Id; _r.hml_Inh1_Procent = Inhaltsstoffe[1].Procent; _r.hml_Inh1_ProcentDo = Inhaltsstoffe[1].ProcentDo; _r.hml_Inh2_Id = Inhaltsstoffe[2].Id; _r.hml_Inh2_Procent = Inhaltsstoffe[2].Procent; _r.hml_Inh2_ProcentDo = Inhaltsstoffe[2].ProcentDo; _r.hml_Inh3_Id = Inhaltsstoffe[3].Id; _r.hml_Inh3_Procent = Inhaltsstoffe[3].Procent; _r.hml_Inh3_ProcentDo = Inhaltsstoffe[3].ProcentDo; _r.hml_Inh4_Id = Inhaltsstoffe[4].Id; _r.hml_Inh4_Procent = Inhaltsstoffe[4].Procent; _r.hml_Inh4_ProcentDo = Inhaltsstoffe[4].ProcentDo; _r.hml_Inh5_Id = Inhaltsstoffe[5].Id; _r.hml_Inh5_Procent = Inhaltsstoffe[5].Procent; _r.hml_Inh5_ProcentDo = Inhaltsstoffe[5].ProcentDo; _r.hml_Inh6_Id = Inhaltsstoffe[6].Id; _r.hml_Inh6_Procent = Inhaltsstoffe[6].Procent; _r.hml_Inh6_ProcentDo = Inhaltsstoffe[6].ProcentDo; _r.hml_Inh7_Id = Inhaltsstoffe[7].Id; _r.hml_Inh7_Procent = Inhaltsstoffe[7].Procent; _r.hml_Inh7_ProcentDo = Inhaltsstoffe[7].ProcentDo; _r.hml_Inh8_Id = Inhaltsstoffe[8].Id; _r.hml_Inh8_Procent = Inhaltsstoffe[8].Procent; _r.hml_Inh8_ProcentDo = Inhaltsstoffe[8].ProcentDo; _r.hml_Inh9_Id = Inhaltsstoffe[9].Id; _r.hml_Inh9_Procent = Inhaltsstoffe[9].Procent; _r.hml_Inh9_ProcentDo = Inhaltsstoffe[9].ProcentDo; _r.hml_Inh10_Id = Inhaltsstoffe[10].Id; _r.hml_Inh10_Procent = Inhaltsstoffe[10].Procent; _r.hml_Inh10_ProcentDo = Inhaltsstoffe[10].ProcentDo; _r.hml_Inh11_Id = Inhaltsstoffe[11].Id; _r.hml_Inh11_Procent = Inhaltsstoffe[11].Procent; _r.hml_Inh11_ProcentDo = Inhaltsstoffe[11].ProcentDo; _r.hml_Inh12_Id = Inhaltsstoffe[12].Id; _r.hml_Inh12_Procent = Inhaltsstoffe[12].Procent; _r.hml_Inh12_ProcentDo = Inhaltsstoffe[12].ProcentDo; _r.hml_Inh13_Id = Inhaltsstoffe[13].Id; _r.hml_Inh13_Procent = Inhaltsstoffe[13].Procent; _r.hml_Inh13_ProcentDo = Inhaltsstoffe[13].ProcentDo; _r.hml_Inh14_Id = Inhaltsstoffe[14].Id; _r.hml_Inh14_Procent = Inhaltsstoffe[14].Procent; _r.hml_Inh14_ProcentDo = Inhaltsstoffe[14].ProcentDo; _r.hml_Inh15_Id = Inhaltsstoffe[15].Id; _r.hml_Inh15_Procent = Inhaltsstoffe[15].Procent; _r.hml_Inh15_ProcentDo = Inhaltsstoffe[15].ProcentDo; _r.hml_Inh16_Id = Inhaltsstoffe[16].Id; _r.hml_Inh16_Procent = Inhaltsstoffe[16].Procent; _r.hml_Inh16_ProcentDo = Inhaltsstoffe[16].ProcentDo; _r.hml_Inh17_Id = Inhaltsstoffe[17].Id; _r.hml_Inh17_Procent = Inhaltsstoffe[17].Procent; _r.hml_Inh17_ProcentDo = Inhaltsstoffe[17].ProcentDo; _r.hml_Inh18_Id = Inhaltsstoffe[18].Id; _r.hml_Inh18_Procent = Inhaltsstoffe[18].Procent; _r.hml_Inh18_ProcentDo = Inhaltsstoffe[18].ProcentDo; _r.hml_Inh19_Id = Inhaltsstoffe[19].Id; _r.hml_Inh19_Procent = Inhaltsstoffe[19].Procent; _r.hml_Inh19_ProcentDo = Inhaltsstoffe[19].ProcentDo; _dtL.AddListaRow(_r); _taL.Update(_r); _dtL.AcceptChanges(); // uaktualnienie danych w tabeli do porównania, czy są zmiany aktualny = (from r in _dtL.AsEnumerable() select r).LastOrDefault(); } } private void wczytaj(int towar) { #region DB DataSetLista.DaneTowaruDataTable _dtTowar = new DataSetLista.DaneTowaruDataTable(); DaneTowaruTableAdapter _taTowar = new DaneTowaruTableAdapter(); _taTowar.ClearBeforeFill = true; _taTowar.Connection.ConnectionString = connstr; DataSetLista.ListaDataTable _dtL = new DataSetLista.ListaDataTable(); ListaTableAdapter _taL = new ListaTableAdapter(); _taL.ClearBeforeFill = true; _taL.Connection.ConnectionString = connstr; try { _taTowar.Fill(_dtTowar, towar); } catch (Exception ex) { MessageBox.Show(string.Format("Problem z tabelą {0}. {1}", _dtTowar.TableName, ex.Message)); } try { _taL.Fill(_dtL, towar); } catch (Exception) { MessageBox.Show(string.Format("Problem z tabelą {0}", _dtL.TableName)); } #endregion if (_dtTowar.Count > 0) { DataSetLista.DaneTowaruRow tow = _dtTowar.FirstOrDefault(); Name = tow.Twr_Kod; Art = tow.Twr_Nazwa; Lieferant = tow.Dostawca; Preis = tow.TwD_Cena; Waluta = tow.TwD_Waluta; Behalter = tow.TwJ_JmZ; } if (_dtL.Count > 0) { #region Aktualne dane DataSetLista.ListaRow a = (from r in _dtL.AsEnumerable() select r).LastOrDefault(); aktualny = a; Herstellort = a.hml_Herstellort; SDS_Obrazek1.Widoczny = a.hml_SDS1; SDS_Obrazek1.Opis = nazwaObrazka(1); SDS_Obrazek2.Widoczny = a.hml_SDS2; SDS_Obrazek2.Opis = nazwaObrazka(2); SDS_Obrazek3.Widoczny = a.hml_SDS3; SDS_Obrazek3.Opis = nazwaObrazka(3); SDS_Obrazek4.Widoczny = a.hml_SDS4; SDS_Obrazek4.Opis = nazwaObrazka(4); SDS_Obrazek5.Widoczny = a.hml_SDS5; SDS_Obrazek5.Opis = nazwaObrazka(5); SDS_Obrazek6.Widoczny = a.hml_SDS6; SDS_Obrazek6.Opis = nazwaObrazka(6); SDS_Obrazek7.Widoczny = a.hml_SDS7; SDS_Obrazek7.Opis = nazwaObrazka(7); SDS_Obrazek8.Widoczny = a.hml_SDS8; SDS_Obrazek8.Opis = nazwaObrazka(8); SDS_Obrazek9.Widoczny = a.hml_SDS9; SDS_Obrazek9.Opis = nazwaObrazka(9); SDS_Obrazek10.Widoczny = a.hml_SDS10; SDS_Obrazek10.Opis = nazwaObrazka(10); SDS_Text = a.hml_SDStext; Schichten = a.hml_Schichten; Eigenschaften = a.hml_Eigenschaften; Anleitung = a.hml_Anleitung; FS_od = a.hml_FS_od; FS_do = a.hml_FS_do; Dichte = a.hml_Dichte; Dichte_do = a.hml_Dichte_do; Viskositat_od = a.hml_Viskositat_od; Viskositat_do = a.hml_Viskositat_do; Farbe = a.hml_Farbe; Verdunnung = a.hml_Verdunnung; Schichtdicke_od = a.hml_Schichtdicke_od; Schichtdicke_do = a.hml_Schichtdicke_do; Leistung_nach_Beschichtung = a.hml_Leistung; Lagerkapazitat = a.hml_Lagerkapazitat; Verarbeitung = a.hml_Verarbeitung; #region 20 składników Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh0_Id, Procent = a.hml_Inh0_Procent, ProcentDo = a.hml_Inh0_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh0_Id select s.Kod).FirstOrDefault(), r.hml_Inh0_Procent.ToString(), r.hml_Inh0_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh1_Id, Procent = a.hml_Inh1_Procent, ProcentDo = a.hml_Inh1_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh1_Id select s.Kod).FirstOrDefault(), r.hml_Inh1_Procent.ToString(), r.hml_Inh1_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh2_Id, Procent = a.hml_Inh2_Procent, ProcentDo = a.hml_Inh2_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh2_Id select s.Kod).FirstOrDefault(), r.hml_Inh2_Procent.ToString(), r.hml_Inh2_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh3_Id, Procent = a.hml_Inh3_Procent, ProcentDo = a.hml_Inh3_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh3_Id select s.Kod).FirstOrDefault(), r.hml_Inh3_Procent.ToString(), r.hml_Inh3_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh4_Id, Procent = a.hml_Inh4_Procent, ProcentDo = a.hml_Inh4_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh4_Id select s.Kod).FirstOrDefault(), r.hml_Inh4_Procent.ToString(), r.hml_Inh4_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh5_Id, Procent = a.hml_Inh5_Procent, ProcentDo = a.hml_Inh5_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh5_Id select s.Kod).FirstOrDefault(), r.hml_Inh5_Procent.ToString(), r.hml_Inh5_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh6_Id, Procent = a.hml_Inh6_Procent, ProcentDo = a.hml_Inh6_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh6_Id select s.Kod).FirstOrDefault(), r.hml_Inh6_Procent.ToString(), r.hml_Inh6_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh7_Id, Procent = a.hml_Inh7_Procent, ProcentDo = a.hml_Inh7_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh7_Id select s.Kod).FirstOrDefault(), r.hml_Inh7_Procent.ToString(), r.hml_Inh7_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh8_Id, Procent = a.hml_Inh8_Procent, ProcentDo = a.hml_Inh8_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh8_Id select s.Kod).FirstOrDefault(), r.hml_Inh8_Procent.ToString(), r.hml_Inh8_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh9_Id, Procent = a.hml_Inh9_Procent, ProcentDo = a.hml_Inh9_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh9_Id select s.Kod).FirstOrDefault(), r.hml_Inh9_Procent.ToString(), r.hml_Inh9_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh10_Id, Procent = a.hml_Inh10_Procent, ProcentDo = a.hml_Inh10_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh10_Id select s.Kod).FirstOrDefault(), r.hml_Inh10_Procent.ToString(), r.hml_Inh10_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh11_Id, Procent = a.hml_Inh11_Procent, ProcentDo = a.hml_Inh11_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh11_Id select s.Kod).FirstOrDefault(), r.hml_Inh11_Procent.ToString(), r.hml_Inh11_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh12_Id, Procent = a.hml_Inh12_Procent, ProcentDo = a.hml_Inh12_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh12_Id select s.Kod).FirstOrDefault(), r.hml_Inh12_Procent.ToString(), r.hml_Inh12_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh13_Id, Procent = a.hml_Inh13_Procent, ProcentDo = a.hml_Inh13_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh13_Id select s.Kod).FirstOrDefault(), r.hml_Inh13_Procent.ToString(), r.hml_Inh13_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh14_Id, Procent = a.hml_Inh14_Procent, ProcentDo = a.hml_Inh14_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh14_Id select s.Kod).FirstOrDefault(), r.hml_Inh14_Procent.ToString(), r.hml_Inh14_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh15_Id, Procent = a.hml_Inh15_Procent, ProcentDo = a.hml_Inh15_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh15_Id select s.Kod).FirstOrDefault(), r.hml_Inh15_Procent.ToString(), r.hml_Inh15_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh16_Id, Procent = a.hml_Inh16_Procent, ProcentDo = a.hml_Inh16_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh16_Id select s.Kod).FirstOrDefault(), r.hml_Inh16_Procent.ToString(), r.hml_Inh16_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh17_Id, Procent = a.hml_Inh17_Procent, ProcentDo = a.hml_Inh17_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh17_Id select s.Kod).FirstOrDefault(), r.hml_Inh17_Procent.ToString(), r.hml_Inh17_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh18_Id, Procent = a.hml_Inh18_Procent, ProcentDo = a.hml_Inh18_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh18_Id select s.Kod).FirstOrDefault(), r.hml_Inh18_Procent.ToString(), r.hml_Inh18_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); Inhaltsstoffe.Add(new Skladnik() { Id = a.hml_Inh19_Id, Procent = a.hml_Inh19_Procent, ProcentDo = a.hml_Inh19_ProcentDo, Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, string.Format("{0}: {1} - {2}", (from s in _skladniki where s.Id == r.hml_Inh19_Id select s.Kod).FirstOrDefault(), r.hml_Inh19_Procent.ToString(), r.hml_Inh19_ProcentDo.ToString()), r.Ope_Ident)).ToList()) }); #endregion #endregion #region Historia Herstellort_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Herstellort, r.Ope_Ident)).ToList()); SDS_Text_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_SDStext, r.Ope_Ident)).ToList()); SDS_Obrazek1.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr( r.hml_SDS1), r.Ope_Ident)).ToList()); SDS_Obrazek2.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS2), r.Ope_Ident)).ToList()); SDS_Obrazek3.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS3), r.Ope_Ident)).ToList()); SDS_Obrazek4.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS4), r.Ope_Ident)).ToList()); SDS_Obrazek5.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS5), r.Ope_Ident)).ToList()); SDS_Obrazek6.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS6), r.Ope_Ident)).ToList()); SDS_Obrazek7.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS7), r.Ope_Ident)).ToList()); SDS_Obrazek8.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS8), r.Ope_Ident)).ToList()); SDS_Obrazek9.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS9), r.Ope_Ident)).ToList()); SDS_Obrazek10.HistoriaObrazka = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, boolToStr(r.hml_SDS10), r.Ope_Ident)).ToList()); Schichten_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Schichten, r.Ope_Ident)).ToList()); Eigenschaften_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Eigenschaften, r.Ope_Ident)).ToList()); Anleitung_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Anleitung, r.Ope_Ident)).ToList()); FS_od_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_FS_od.ToString(), r.Ope_Ident)).ToList()); FS_do_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_FS_do.ToString(), r.Ope_Ident)).ToList()); Dichte_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Dichte.ToString(), r.Ope_Ident)).ToList()); Dichte_do_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Dichte_do.ToString(), r.Ope_Ident)).ToList()); Viskositat_od_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Viskositat_od.ToString(), r.Ope_Ident)).ToList()); Viskositat_do_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Viskositat_do.ToString(), r.Ope_Ident)).ToList()); Farbe_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Farbe, r.Ope_Ident)).ToList()); Verdunnung_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Verdunnung, r.Ope_Ident)).ToList()); Schichtdicke_od_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Schichtdicke_od.ToString(), r.Ope_Ident)).ToList()); Schichtdicke_do_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Schichtdicke_do.ToString(), r.Ope_Ident)).ToList()); Leistung_nach_Beschichtung_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Leistung.ToString(), r.Ope_Ident)).ToList()); Lagerkapazitat_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Lagerkapazitat.ToString(), r.Ope_Ident)).ToList()); Verarbeitung_Historia = czyscHistorie((from r in _dtL.AsEnumerable() select new Historia(r.hml_DataPowstania, r.hml_Verarbeitung, r.Ope_Ident)).ToList()); #endregion } else { for (int licz = 0; licz <= 19; licz++) { Inhaltsstoffe.Add(new Skladnik()); } } } #region Name private string _name = string.Empty; public string Name { get => _name; set { _name = value; OnPropertyChanged(); } } #endregion #region Lieferant private string _lieferant = string.Empty; public string Lieferant { get => _lieferant; set { _lieferant = value; OnPropertyChanged(); } } #endregion #region Herstellort /// /// miejsce produkcji /// private string _herstellort = string.Empty; public string Herstellort { get { return _herstellort; } set { _herstellort = value; OnPropertyChanged("Herstellort"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Herstellort_Historia { get; set; } #endregion #region Artikel private string _art = string.Empty; public string Art { get { return _art; } set { _art = value; OnPropertyChanged("Art"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } #endregion #region SDS obrazki x10 private Obrazek _sds_obrazek1 = new Obrazek(); public Obrazek SDS_Obrazek1 { get { return _sds_obrazek1; } set { _sds_obrazek1 = value; OnPropertyChanged("SDS_Obrazek1"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek2 = new Obrazek(); public Obrazek SDS_Obrazek2 { get { return _sds_obrazek2; } set { _sds_obrazek2 = value; OnPropertyChanged("SDS_Obrazek2"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek3 = new Obrazek(); public Obrazek SDS_Obrazek3 { get { return _sds_obrazek3; } set { _sds_obrazek3 = value; OnPropertyChanged("SDS_Obrazek3"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek4 = new Obrazek(); public Obrazek SDS_Obrazek4 { get { return _sds_obrazek4; } set { _sds_obrazek4 = value; OnPropertyChanged("SDS_Obrazek4"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek5 = new Obrazek(); public Obrazek SDS_Obrazek5 { get { return _sds_obrazek5; } set { _sds_obrazek5 = value; OnPropertyChanged("SDS_Obrazek5"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek6 = new Obrazek(); public Obrazek SDS_Obrazek6 { get { return _sds_obrazek6; } set { _sds_obrazek6 = value; OnPropertyChanged("SDS_Obrazek6"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek7 = new Obrazek(); public Obrazek SDS_Obrazek7 { get { return _sds_obrazek7; } set { _sds_obrazek7 = value; OnPropertyChanged("SDS_Obrazek7"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek8 = new Obrazek(); public Obrazek SDS_Obrazek8 { get { return _sds_obrazek8; } set { _sds_obrazek8 = value; OnPropertyChanged("SDS_Obrazek8"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek9 = new Obrazek(); public Obrazek SDS_Obrazek9 { get { return _sds_obrazek9; } set { _sds_obrazek9 = value; OnPropertyChanged("SDS_Obrazek9"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } private Obrazek _sds_obrazek10 = new Obrazek(); public Obrazek SDS_Obrazek10 { get { return _sds_obrazek10; } set { _sds_obrazek10 = value; OnPropertyChanged("SDS_Obrazek10"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } #endregion #region SDS text private string _sds_text = string.Empty; public string SDS_Text { get { return _sds_text; } set { _sds_text = value; OnPropertyChanged("SDS_Text"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List SDS_Text_Historia { get; set; } #endregion #region SDS text automatyczny public string SDS_Text_auto { get { StringBuilder sb = new StringBuilder(); if (SDS_Obrazek1.Widoczny) sb.Append(SDS_Obrazek1.Opis + ", "); if (SDS_Obrazek2.Widoczny) sb.Append(SDS_Obrazek2.Opis + ", "); if (SDS_Obrazek3.Widoczny) sb.Append(SDS_Obrazek3.Opis + ", "); if (SDS_Obrazek4.Widoczny) sb.Append(SDS_Obrazek4.Opis + ", "); if (SDS_Obrazek5.Widoczny) sb.Append(SDS_Obrazek5.Opis + ", "); if (SDS_Obrazek6.Widoczny) sb.Append(SDS_Obrazek6.Opis + ", "); if (SDS_Obrazek7.Widoczny) sb.Append(SDS_Obrazek7.Opis + ", "); if (SDS_Obrazek8.Widoczny) sb.Append(SDS_Obrazek8.Opis + ", "); if (SDS_Obrazek9.Widoczny) sb.Append(SDS_Obrazek9.Opis + ", "); if (SDS_Obrazek10.Widoczny) sb.Append(SDS_Obrazek10.Opis); return sb.ToString(); } } #endregion #region Schichten /// /// warstwy /// private string _schichten = string.Empty; public string Schichten { get { return _schichten; } set { _schichten = value; OnPropertyChanged("Schichten"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Schichten_Historia { get; set; } #endregion #region Eigenschaften /// /// właściwości /// private string _eigenschaften = string.Empty; public string Eigenschaften { get { return _eigenschaften; } set { _eigenschaften = value; OnPropertyChanged("Eigenschaften"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Eigenschaften_Historia { get; set; } #endregion #region Anleitung /// /// instrukcje /// private string _anleitung = string.Empty; public string Anleitung { get { return _anleitung; } set { _anleitung = value; OnPropertyChanged("Anleitung"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Anleitung_Historia { get; set; } #endregion #region FS_od /// /// substancje stałe od /// private decimal _FS_od = 0; public decimal FS_od { get { return _FS_od; } set { _FS_od = value; OnPropertyChanged("FS_od"); OnPropertyChanged("FS_do"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List FS_od_Historia { get; set; } #endregion #region FS_do /// /// substancje stałe do /// private decimal _FS_do = 0; public decimal FS_do { get { return _FS_do; } set { _FS_do = value; OnPropertyChanged("FS_do"); OnPropertyChanged("FS_od"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List FS_do_Historia { get; set; } #endregion #region Dichte /// /// gęstość /// private decimal _dichte = 0; public decimal Dichte { get { return _dichte; } set { _dichte = value; OnPropertyChanged("Dichte"); OnPropertyChanged("Dichte_do"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Dichte_Historia { get; set; } #endregion #region Dichte_do /// /// gęstość /// private decimal _dichte_do = 0; public decimal Dichte_do { get { return _dichte_do; } set { _dichte_do = value; OnPropertyChanged("Dichte_do"); OnPropertyChanged("Dichte"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Dichte_do_Historia { get; set; } #endregion #region Viskositat_od /// /// lepkość od /// private decimal _viskositat_od = 0; public decimal Viskositat_od { get { return _viskositat_od; } set { _viskositat_od = value; OnPropertyChanged("Viskositat_od"); OnPropertyChanged("IsChanged"); OnPropertyChanged("Viskositat_do"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Viskositat_od_Historia { get; set; } #endregion #region Viskositat_do /// /// lepkość do /// private decimal _viskositat_do = 0; public decimal Viskositat_do { get { return _viskositat_do; } set { _viskositat_do = value; OnPropertyChanged("Viskositat_do"); OnPropertyChanged("IsChanged"); OnPropertyChanged("Viskositat_od"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Viskositat_do_Historia { get; set; } #endregion #region Farbe private string _farbe = string.Empty; /// /// Kolor /// public string Farbe { get { return _farbe; } set { _farbe = value; OnPropertyChanged("Farbe"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Farbe_Historia { get; set; } #endregion #region Verdunnung /// /// Rozcieńczenie /// private string _verdunnung = string.Empty; public string Verdunnung { get { return _verdunnung; } set { _verdunnung = value; OnPropertyChanged("Verdunnung"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Verdunnung_Historia { get; set; } #endregion #region Schichtdicke_od /// /// Grubość powłoki od /// private decimal _schichtdicke_od = 0; public decimal Schichtdicke_od { get { return _schichtdicke_od; } set { _schichtdicke_od = value; OnPropertyChanged("Schichtdicke_od"); OnPropertyChanged("Schichtdicke_do"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Schichtdicke_od_Historia { get; set; } #endregion #region Schichtdicke_do /// /// Grubość powłoki do /// private decimal _schichtdicke_do = 0; public decimal Schichtdicke_do { get { return _schichtdicke_do; } set { _schichtdicke_do = value; OnPropertyChanged("Schichtdicke_do"); OnPropertyChanged("Schichtdicke_od"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Schichtdicke_do_Historia { get; set; } #endregion #region Leistung nach Beschichtung /// /// Wydajność po pokryciu /// private decimal _leistung_nach_besch = 0; public decimal Leistung_nach_Beschichtung { get { return _leistung_nach_besch; } set { _leistung_nach_besch = value; OnPropertyChanged("Leistung_nach_Beschichtung"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Leistung_nach_Beschichtung_Historia { get; set; } #endregion #region Lagerkapazitat /// /// Pojemność magazynowa - Lagerkapazität /// private decimal _lagerkapazitat = 0; public decimal Lagerkapazitat { get { return _lagerkapazitat; } set { _lagerkapazitat = value; OnPropertyChanged("Lagerkapazitat"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Lagerkapazitat_Historia { get; set; } #endregion #region Verarbeitung /// /// ?? /// private string _verarbeitung = string.Empty; public string Verarbeitung { get { return _verarbeitung; } set { _verarbeitung = value; OnPropertyChanged("Verarbeitung"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public List Verarbeitung_Historia { get; set; } #endregion #region Inhaltsstoffe /// /// składniki /// private ObservableCollection _inhaltsstoffe = new ObservableCollection(); public ObservableCollection Inhaltsstoffe { get { return _inhaltsstoffe; } } #endregion #region Preis private decimal _preis = 0; /// /// Cena /// public decimal Preis { get { return _preis; } set { _preis = value; OnPropertyChanged("Preis"); OnPropertyChanged("IsChanged"); } } #endregion #region Einheit preis /// /// Cena jednostkowa /// private decimal _einheit_preis = 0; public decimal Einheit_preis { get { return _einheit_preis; } private set { _einheit_preis = value; OnPropertyChanged("Einheit_preis"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } public bool Einheit_preis_error { get; set; } #endregion #region Behalter /// /// Pojemnik /// private string _behalter = string.Empty; public string Behalter { get { return _behalter; } set { _behalter = value; OnPropertyChanged("Behalter"); OnPropertyChanged("IsChanged"); _zapiszCommand.RaiseCanExecuteChanged(); } } //public List Behalter_Historia //{ get; set; } #endregion #region Waluta public string Waluta { get; set; } #endregion #region komenda Zapisz private readonly DelegateCommand _zapiszCommand; public DelegateCommand Zapisz { get { return _zapiszCommand; } } #endregion #region Obsługa INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged([CallerMemberName] string name = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); #endregion #region Obsługa IDataErrorInfo public string Error => throw new NotImplementedException(); public string this[string columnName] { get { string result = null; #region FS if (columnName == "FS_od") { if (FS_od < 0 || FS_od > 100) result = "tylko wartości od 0 do 100"; if (FS_od > FS_do) result = "wartość OD jest za mała"; } if (columnName == "FS_do") { if (FS_do < 0 || FS_do > 100) result = "tylko wartości od 0 do 100"; if (FS_od > FS_do) result = "wartość DO jest za duża"; } #endregion #region Dichte if (columnName == "Dichte_do") { if (Dichte > Dichte_do) result = "wartość DO jest za duża"; } if (columnName == "Dichte") { if (Dichte > Dichte_do) result = "wartość OD jest za mała"; } #endregion #region Viskositat if (columnName == "Viskositat_do") { if (Viskositat_od > Viskositat_do) result = "wartość DO jest za duża"; } if (columnName == "Viskositat_od") { if (Viskositat_od > Viskositat_do) result = "wartość OD jest za mała"; } #endregion #region Schichtdicke if (columnName == "Schichtdicke_od") { if (Schichtdicke_od > Schichtdicke_do) result = "wartość OD jest za mała"; } if (columnName == "Schichtdicke_do") { if (Schichtdicke_od > Schichtdicke_do) result = "wartość DO jest za duża"; } #endregion return result; } } #endregion #region Obsługa IChangeTracking public void AcceptChanges() => throw new NotImplementedException(); public bool IsChanged { get { if (aktualny != null) { return !( (Herstellort == aktualny.hml_Herstellort) & (SDS_Obrazek1.Widoczny == aktualny.hml_SDS1) & (SDS_Obrazek2.Widoczny == aktualny.hml_SDS2) & (SDS_Obrazek3.Widoczny == aktualny.hml_SDS3) & (SDS_Obrazek4.Widoczny == aktualny.hml_SDS4) & (SDS_Obrazek5.Widoczny == aktualny.hml_SDS5) & (SDS_Obrazek6.Widoczny == aktualny.hml_SDS6) & (SDS_Obrazek7.Widoczny == aktualny.hml_SDS7) & (SDS_Obrazek8.Widoczny == aktualny.hml_SDS8) & (SDS_Obrazek9.Widoczny == aktualny.hml_SDS9) & (SDS_Obrazek10.Widoczny == aktualny.hml_SDS10) & (SDS_Text == aktualny.hml_SDStext) & (Schichten == aktualny.hml_Schichten) & (Eigenschaften == aktualny.hml_Eigenschaften) & (Anleitung == aktualny.hml_Anleitung) & (FS_od == aktualny.hml_FS_od) & (FS_do == aktualny.hml_FS_do) & (Dichte == aktualny.hml_Dichte) & (Dichte_do == aktualny.hml_Dichte_do) & (Viskositat_od == aktualny.hml_Viskositat_od) & (Viskositat_do == aktualny.hml_Viskositat_do) & (Farbe == aktualny.hml_Farbe) & (Verdunnung == aktualny.hml_Verdunnung) & (Schichtdicke_od == aktualny.hml_Schichtdicke_od) & (Schichtdicke_do == aktualny.hml_Schichtdicke_do) & (Leistung_nach_Beschichtung == aktualny.hml_Leistung) & (Lagerkapazitat == aktualny.hml_Lagerkapazitat) & (Verarbeitung == aktualny.hml_Verarbeitung) & (Inhaltsstoffe[0].Id == aktualny.hml_Inh0_Id) & (Inhaltsstoffe[1].Id == aktualny.hml_Inh1_Id) & (Inhaltsstoffe[2].Id == aktualny.hml_Inh2_Id) & (Inhaltsstoffe[3].Id == aktualny.hml_Inh3_Id) & (Inhaltsstoffe[4].Id == aktualny.hml_Inh4_Id) & (Inhaltsstoffe[5].Id == aktualny.hml_Inh5_Id) & (Inhaltsstoffe[6].Id == aktualny.hml_Inh6_Id) & (Inhaltsstoffe[7].Id == aktualny.hml_Inh7_Id) & (Inhaltsstoffe[8].Id == aktualny.hml_Inh8_Id) & (Inhaltsstoffe[9].Id == aktualny.hml_Inh9_Id) & (Inhaltsstoffe[10].Id == aktualny.hml_Inh10_Id) & (Inhaltsstoffe[11].Id == aktualny.hml_Inh11_Id) & (Inhaltsstoffe[12].Id == aktualny.hml_Inh12_Id) & (Inhaltsstoffe[13].Id == aktualny.hml_Inh13_Id) & (Inhaltsstoffe[14].Id == aktualny.hml_Inh14_Id) & (Inhaltsstoffe[15].Id == aktualny.hml_Inh15_Id) & (Inhaltsstoffe[16].Id == aktualny.hml_Inh16_Id) & (Inhaltsstoffe[17].Id == aktualny.hml_Inh17_Id) & (Inhaltsstoffe[18].Id == aktualny.hml_Inh18_Id) & (Inhaltsstoffe[19].Id == aktualny.hml_Inh19_Id) & (Inhaltsstoffe[0].Procent == aktualny.hml_Inh0_Procent) & (Inhaltsstoffe[1].Procent == aktualny.hml_Inh1_Procent) & (Inhaltsstoffe[2].Procent == aktualny.hml_Inh2_Procent) & (Inhaltsstoffe[3].Procent == aktualny.hml_Inh3_Procent) & (Inhaltsstoffe[4].Procent == aktualny.hml_Inh4_Procent) & (Inhaltsstoffe[5].Procent == aktualny.hml_Inh5_Procent) & (Inhaltsstoffe[6].Procent == aktualny.hml_Inh6_Procent) & (Inhaltsstoffe[7].Procent == aktualny.hml_Inh7_Procent) & (Inhaltsstoffe[8].Procent == aktualny.hml_Inh8_Procent) & (Inhaltsstoffe[9].Procent == aktualny.hml_Inh9_Procent) & (Inhaltsstoffe[10].Procent == aktualny.hml_Inh10_Procent) & (Inhaltsstoffe[11].Procent == aktualny.hml_Inh11_Procent) & (Inhaltsstoffe[12].Procent == aktualny.hml_Inh12_Procent) & (Inhaltsstoffe[13].Procent == aktualny.hml_Inh13_Procent) & (Inhaltsstoffe[14].Procent == aktualny.hml_Inh14_Procent) & (Inhaltsstoffe[15].Procent == aktualny.hml_Inh15_Procent) & (Inhaltsstoffe[16].Procent == aktualny.hml_Inh16_Procent) & (Inhaltsstoffe[17].Procent == aktualny.hml_Inh17_Procent) & (Inhaltsstoffe[18].Procent == aktualny.hml_Inh18_Procent) & (Inhaltsstoffe[19].Procent == aktualny.hml_Inh19_Procent) & (Inhaltsstoffe[0].ProcentDo == aktualny.hml_Inh0_ProcentDo) & (Inhaltsstoffe[1].ProcentDo == aktualny.hml_Inh1_ProcentDo) & (Inhaltsstoffe[2].ProcentDo == aktualny.hml_Inh2_ProcentDo) & (Inhaltsstoffe[3].ProcentDo == aktualny.hml_Inh3_ProcentDo) & (Inhaltsstoffe[4].ProcentDo == aktualny.hml_Inh4_ProcentDo) & (Inhaltsstoffe[5].ProcentDo == aktualny.hml_Inh5_ProcentDo) & (Inhaltsstoffe[6].ProcentDo == aktualny.hml_Inh6_ProcentDo) & (Inhaltsstoffe[7].ProcentDo == aktualny.hml_Inh7_ProcentDo) & (Inhaltsstoffe[8].ProcentDo == aktualny.hml_Inh8_ProcentDo) & (Inhaltsstoffe[9].ProcentDo == aktualny.hml_Inh9_ProcentDo) & (Inhaltsstoffe[10].ProcentDo == aktualny.hml_Inh10_ProcentDo) & (Inhaltsstoffe[11].ProcentDo == aktualny.hml_Inh11_ProcentDo) & (Inhaltsstoffe[12].ProcentDo == aktualny.hml_Inh12_ProcentDo) & (Inhaltsstoffe[13].ProcentDo == aktualny.hml_Inh13_ProcentDo) & (Inhaltsstoffe[14].ProcentDo == aktualny.hml_Inh14_ProcentDo) & (Inhaltsstoffe[15].ProcentDo == aktualny.hml_Inh15_ProcentDo) & (Inhaltsstoffe[16].ProcentDo == aktualny.hml_Inh16_ProcentDo) & (Inhaltsstoffe[17].ProcentDo == aktualny.hml_Inh17_ProcentDo) & (Inhaltsstoffe[18].ProcentDo == aktualny.hml_Inh18_ProcentDo) & (Inhaltsstoffe[19].ProcentDo == aktualny.hml_Inh19_ProcentDo) ); } else { return true; } } } #endregion } }