private void KallaSistaID() { int sistaMatID; Lunch kalladLunch = new Lunch(); kalladLunch = lunchList.Lunchlist[lunchList.Lunchlist.Count - 1]; sistaMatID = kalladLunch.MatID; iDKalk.KallaID(sistaMatID); }
private void RegistreraMat() { if (MatNamn == "") { MessageBox.Show("ごはんのなまえをいれよう"); } else { lunch = new Lunch(); iDKalk.RegistreraID(); lunch.RegistreraLunch(MatNamn, Ingredienser, iDKalk.ID); lunchList.RegistreraList(lunch); } }
private void VisaSlumpAvIng() { string slumpMat = ""; slumpLunch = slumpLunch.OrderBy(i => Guid.NewGuid()).ToList(); Lunch resultLunch = new Lunch(); resultLunch = slumpLunch[0]; ResultMat.Content = resultLunch.MatNamn; list6.Items.Clear(); foreach (var ing in resultLunch.Ingredienser) { list6.Items.Add($"- {ing}"); } slumpMat = resultLunch.MatNamn; MessageBox.Show($"きょうのごはんは・・・・ {slumpMat}だあっ!"); }
public void RegistreraList(Lunch lunch) { Lunchlist.Add(lunch); }