示例#1
0
        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", "");
            }
        }
示例#2
0
 private void CancelClick(object sender, RoutedEventArgs e)
 {
     foreach (MyyntiArtikkeli ma in tapahtuma.myyntitapahtuma.ostoslista.myyntiArtikkelit)
     {
         ma.maara = 0;
     }
     BackStackClass.WindowNotify(null, null);
     UpdatePage();
 }
示例#3
0
        private void LisaaTuotettaClick(object sender, RoutedEventArgs e)
        {
            MyyntiArtikkeli ma = (MyyntiArtikkeli)listArtikkelit.SelectedItem;

            if (ma != null)
            {
                ma.maara++;
                BackStackClass.WindowNotify(null, null);
                UpdatePage();
            }
        }