コード例 #1
0
        private void AddEmptyLUValue()
        {
            LUEntry newValue = new LUEntry();

            newValue.OnAuftragsgeberChanged = new Func <string, LUEntry, string>(LoadRechnungsnummerForLUEntry);
            LUCollection.Add(newValue);

            SyncHashMapWithFirmenCollection();
        }
コード例 #2
0
        public List <LUEntry> LoadCollectionLUEntry(String month)
        {
            try
            {
                Leistungsuebersicht = new SLDocument("Leistungsübersicht.xlsx");
            }
            catch (System.IO.FileNotFoundException e)
            {
                Leistungsuebersicht = new SLDocument();
                Leistungsuebersicht.SaveAs("Leistungsübersicht.xlsx");
                Leistungsuebersicht = new SLDocument("Leistungsübersicht.xlsx");
            }
            catch (System.IO.IOException f)
            {
                throw f;
            }

            _InitWorkSheets(Leistungsuebersicht);
            Leistungsuebersicht.SelectWorksheet(month);

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

            for (int i = 2; i < 102; i++)
            {
                LUEntry temp = new LUEntry();
                temp.ID            = Leistungsuebersicht.GetCellValueAsInt32("A" + i.ToString());
                temp.Datum         = Leistungsuebersicht.GetCellValueAsString("B" + i.ToString());
                temp.RechnNr       = Leistungsuebersicht.GetCellValueAsInt32("C" + i.ToString());
                temp.Auftragsgeber = Leistungsuebersicht.GetCellValueAsString("D" + i.ToString());
                temp.Autotyp       = Constants.getAutotypOfString(Leistungsuebersicht.GetCellValueAsString("E" + i.ToString()));
                temp.Fahrer        = Leistungsuebersicht.GetCellValueAsString("F" + i.ToString());
                temp.Beladeort     = Leistungsuebersicht.GetCellValueAsString("G" + i.ToString());
                temp.Entladeort    = Leistungsuebersicht.GetCellValueAsString("H" + i.ToString());
                temp.Preis_Netto   = Leistungsuebersicht.GetCellValueAsDouble("I" + i.ToString());
                temp.WarteZeit     = Leistungsuebersicht.GetCellValueAsDouble("J" + i.ToString());
                temp.BeEntladezeit = Leistungsuebersicht.GetCellValueAsDouble("K" + i.ToString());
                temp.Rückfracht    = Leistungsuebersicht.GetCellValueAsDouble("L" + i.ToString());
                temp.Maut          = Leistungsuebersicht.GetCellValueAsDouble("M" + i.ToString());
                temp.GesamtNetto   = Leistungsuebersicht.GetCellValueAsDouble("N" + i.ToString());

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

            return(tempList);
        }
コード例 #3
0
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            LUEntry entry = (value as BindingGroup).Items[0] as LUEntry;

            if (string.IsNullOrEmpty(entry.Datum))
            {
                return(new ValidationResult(false, "Datum darf nicht leer sein!"));
            }



            return(ValidationResult.ValidResult);
        }
コード例 #4
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
        }