예제 #1
0
        public List <Firma> LoadCollectionFirma()
        {
            try
            {
                Firmen = new SLDocument("Firmen.xlsx");
            }
            catch (System.IO.FileNotFoundException e)
            {
                Firmen = new SLDocument();
                Firmen.SaveAs("Firmen.xlsx");
                Firmen = new SLDocument("Firmen.xlsx");
            }
            catch (System.IO.IOException f)
            {
                throw f;
            }

            List <Firma> tempList = new List <Firma>();

            for (int i = 2; i < 102; i++)
            {
                Firma temp = new Firma();
                temp.Name                       = Firmen.GetCellValueAsString("B" + i.ToString());
                temp.Ansprechpartner            = Firmen.GetCellValueAsString("C" + i.ToString());
                temp.StraßeUndNr                = Firmen.GetCellValueAsString("D" + i.ToString());
                temp.PLZ                        = Firmen.GetCellValueAsString("E" + i.ToString());
                temp.Ort                        = Firmen.GetCellValueAsString("F" + i.ToString());
                temp.Land                       = Firmen.GetCellValueAsString("G" + i.ToString());
                temp.CurrentRechnungsNr         = Firmen.GetCellValueAsInt32("H" + i.ToString());
                temp.CountForCurrentRechnungsNr = Firmen.GetCellValueAsInt32("I" + ToString());

                if (string.IsNullOrEmpty(temp.Name))
                {
                    break;
                }
                else
                {
                    tempList.Add(temp);
                }
            }

            return(tempList);
        }
예제 #2
0
 public void EditFirmaFromCodeBehind(Firma firma)
 {
     if (firma != null)
     {
         List <Firma> tempList = FirmenCollection.ToList();
         foreach (Firma item in FirmenCollection)
         {
             if (firma.Name.Equals(item.Name))
             {
                 item.Ansprechpartner = firma.Ansprechpartner;
                 item.Land            = firma.Land;
                 item.PLZ             = firma.PLZ;
                 item.Ort             = firma.Ort;
                 item.StraßeUndNr     = firma.StraßeUndNr;
                 FirmenCollection     = new ObservableCollection <Firma>(tempList);
                 break;
             }
         }
     }
     SyncHashMapWithFirmenCollection();
 }
예제 #3
0
        private String LoadRechnungsnummerForLUEntry(String firma, LUEntry changedItem)
        {
            foreach (Firma item in FirmenCollection)
            {
                if (item.Name.Equals(firma))
                {
                    Firma holderFirma = item;

                    if (changedItem.RechnNr == 0)
                    {
                        if (holderFirma.CountForCurrentRechnungsNr == 0)
                        {
                            holderFirma.CurrentRechnungsNr++;
                        }

                        holderFirma.CountForCurrentRechnungsNr++;

                        if (holderFirma.CountForCurrentRechnungsNr > 30)
                        {
                            holderFirma.CountForCurrentRechnungsNr = 0;
                            holderFirma.CurrentRechnungsNr++;
                        }

                        LUEntry holder = changedItem;

                        holder.RechnNr = item.CurrentRechnungsNr;

                        LUCollection.Remove(changedItem);
                        LUCollection.Add(holder);

                        FirmenCollection.Remove(item);
                        FirmenCollection.Add(holderFirma);

                        return(""); //just pseudo
                    }
                }
            }
            return(""); //just pseudo
        }
예제 #4
0
 private void EditFirmaFromDialog(Firma entry)
 {
     vm.EditFirmaFromCodeBehind(entry);
 }
예제 #5
0
 private void AddFirmaFromDialog(Firma entry)
 {
     vm.AddFirmaFromCodeBehind(entry);
 }
예제 #6
0
 private void InitValuesAndCollections()
 {
     AddFirmaValue = new Firma();
 }
예제 #7
0
 public void AddFirmaFromCodeBehind(Firma firma)
 {
     FirmenCollection.Add(firma);
     SyncHashMapWithFirmenCollection();
 }