Пример #1
0
 public void OnGet([FromServices]  ERPModel2 ef)
 {
     if (SearchString != null)
     {
         Liste = ef.Rechnung.Include("Positionen").Where(x => x.KundenID.ToString().Contains(SearchString)).ToList();
     }
     else
     {
         Liste = ef.Rechnung.Include("Positionen").ToList();
     }
 }
Пример #2
0
        public void OnGet([FromServices]  ERPModel2 ef)
        {
            var rand = new Random();

            for (int i = 0; i < 100; i++)
            {
                var r = new Rechnung()
                {
                    Datum = DateTime.Now.AddDays(rand.Next(300)), KundenID = rand.Next(100000)
                };
                for (int ii = 1; ii < rand.Next(5); ii++)
                {
                    r.Positionen.Add(new Positionen()
                    {
                        Anzahl = rand.Next(3), Preis = rand.Next(99), Text = "demo" + rand.Next(10000).ToString()
                    });
                }

                r.Summe = r.Positionen.Sum(x => x.Anzahl * x.Preis);
                ef.Rechnung.Add(r);
                ef.SaveChanges();
            }
        }
Пример #3
0
 public void OnGet([FromServices]  ERPModel2 ef)
 {
     Liste = ef.Rechnung.Include("Positionen").ToList();
 }
Пример #4
0
 public RechnungEditModel(ERPModel2 ef)
 {
     _ef = ef;
 }
 public PartialViewResult OnGetLadeNext([FromServices] ERPModel2 ef)
 {
     Liste = ef.Rechnung.Skip(SeiteCounter * 10).Take(10).ToList();
     return(Partial("_RechnungenPartialPaging", this));
 }