private void SaatuTextChanged(object sender, TextChangedEventArgs e) { string s = SaatuBox.Text; float saatu; float takaisin; float summa; if (s != "") { bool isNumeric = float.TryParse(s, out saatu); if (isNumeric) { SaatuBoxOkString = s; isNumeric = float.TryParse(SumBlock.Text, out summa); if (isNumeric) { takaisin = saatu - summa; ErotusBlock.Text = takaisin.ToString(); BackStackClass.WindowNotify("saatu", saatu.ToString()); BackStackClass.WindowNotify("Erotus", takaisin.ToString()); } } else { SaatuBox.Text = SaatuBoxOkString; SaatuBox.SelectionStart = SaatuBox.Text.Length; // Sets the cursor to the end of the text SaatuBox.SelectionLength = 0; // Sets the cursor to the end of the text BackStackClass.WindowNotify("saatu", SaatuBoxOkString); } } else // s == "" { BackStackClass.WindowNotify("saatu", ""); } }
private void CancelClick(object sender, RoutedEventArgs e) { foreach (MyyntiArtikkeli ma in tapahtuma.myyntitapahtuma.ostoslista.myyntiArtikkelit) { ma.maara = 0; } BackStackClass.WindowNotify(null, null); UpdatePage(); }
private void LisaaTuotettaClick(object sender, RoutedEventArgs e) { MyyntiArtikkeli ma = (MyyntiArtikkeli)listArtikkelit.SelectedItem; if (ma != null) { ma.maara++; BackStackClass.WindowNotify(null, null); UpdatePage(); } }