private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button but     = sender as Button;
            string content = but.Content as string;
            //look for count as included in button label after (
            int pos = content.IndexOf('(');

            if (pos == -1)
            {
                pos = content.Count();
            }
            vm.reason = content.Substring(0, pos);

            string message = vm.saveQCS(Barcode.Text, vm.reason);

            if (message != string.Empty)
            {
                Errormsg.Text       = message;
                ErrorTxt.Visibility = Visibility.Visible;
                return;
            }
            print popup = new print(vm);

            popup.ShowDialog();

            Barcode.Text = "";
            Barcode.Focus();
            BarcodeChars      = 0;
            vm.BarcodeEntered = false;
        }
示例#2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Button but = sender as Button;

            vm.reason = but.Content as string;
            string message = vm.saveQCS(Barcode.Text, vm.reason);

            if (message != string.Empty)
            {
                Errormsg.Text       = message;
                ErrorTxt.Visibility = Visibility.Visible;
                return;
            }
            print popup = new print();

            popup.ShowDialog();
            Barcode.Text = "";
            Barcode.Focus();
            BarcodeChars = 0;
        }