|
@@ -2,6 +2,7 @@
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
+using System.Text.RegularExpressions;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
@@ -37,6 +38,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
private void Code_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code1.Select(text_Code1.Text.Length, 0);
|
|
|
if (text_Code1.Text.Length == 1)
|
|
|
{
|
|
|
text_Code2.Focus();
|
|
@@ -45,23 +47,25 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
else if (text_Code1.Text.Length > 1)
|
|
|
{
|
|
|
string str = text_Code1.Text;
|
|
|
-
|
|
|
- text_Code1.Text = str.Substring(0, 1);
|
|
|
+
|
|
|
+ text_Code1.Text = str.Substring(0, 1);
|
|
|
str = str.Remove(0, 1);
|
|
|
- if(str.Length>0)
|
|
|
+ if (str.Length > 0)
|
|
|
{
|
|
|
text_Code2.Text = str;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code2_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
+
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code2.Select(text_Code2.Text.Length, 0);
|
|
|
if (text_Code2.Text.Length == 1)
|
|
|
{
|
|
|
text_Code3.Focus();
|
|
@@ -77,13 +81,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
{
|
|
|
text_Code3.Text = str;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code3_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code3.Select(text_Code3.Text.Length, 0);
|
|
|
if (text_Code3.Text.Length == 1)
|
|
|
{
|
|
|
text_Code4.Focus();
|
|
@@ -92,20 +97,20 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
else if (text_Code3.Text.Length > 1)
|
|
|
{
|
|
|
string str = text_Code3.Text;
|
|
|
-
|
|
|
text_Code3.Text = str.Substring(0, 1);
|
|
|
str = str.Remove(0, 1);
|
|
|
if (str.Length > 0)
|
|
|
{
|
|
|
text_Code4.Text = str;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code4_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code4.Select(text_Code4.Text.Length, 0);
|
|
|
if (this.text_Code4.Text.Length == 1)
|
|
|
{
|
|
|
this.text_Code5.Focus();
|
|
@@ -121,13 +126,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
{
|
|
|
text_Code5.Text = str;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code5_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code5.Select(text_Code5.Text.Length, 0);
|
|
|
if (this.text_Code5.Text.Length == 1)
|
|
|
{
|
|
|
this.text_Code6.Focus();
|
|
@@ -143,25 +149,25 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
{
|
|
|
text_Code6.Text = str;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code6_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
{
|
|
|
Grid_RegisterVis.Visibility = Visibility.Collapsed;
|
|
|
+ text_Code6.Select(text_Code6.Text.Length, 0);
|
|
|
if (this.text_Code6.Text.Length == 1)
|
|
|
{
|
|
|
text_Code6.Focus();
|
|
|
}
|
|
|
|
|
|
- else
|
|
|
- if(text_Code6.Text.Length >1)
|
|
|
+ else if (text_Code6.Text.Length > 1)
|
|
|
{
|
|
|
string str = text_Code6.Text;
|
|
|
text_Code6.Focus();
|
|
|
text_Code6.Text = str.Substring(0, 1);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -182,44 +188,54 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
|
|
|
{
|
|
|
text_Code2.Text = "";
|
|
|
text_Code1.Focus();
|
|
|
+ text_Code1.Select(text_Code1.Text.Length, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code3_KeyUp(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
- if (e.Key == Key.Back )
|
|
|
+ if (e.Key == Key.Back)
|
|
|
{
|
|
|
text_Code3.Text = "";
|
|
|
text_Code2.Focus();
|
|
|
+ text_Code2.Select(text_Code2.Text.Length, 0);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void text_Code4_KeyUp(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
- if (e.Key == Key.Back )
|
|
|
+ if (e.Key == Key.Back)
|
|
|
{
|
|
|
text_Code4.Text = "";
|
|
|
text_Code3.Focus();
|
|
|
+ text_Code3.Select(text_Code3.Text.Length, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code5_KeyUp(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
- if (e.Key == Key.Back )
|
|
|
+ if (e.Key == Key.Back)
|
|
|
{
|
|
|
text_Code5.Text = "";
|
|
|
text_Code4.Focus();
|
|
|
+ text_Code4.Select(text_Code4.Text.Length, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void text_Code6_KeyUp(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
- if (e.Key == Key.Back )
|
|
|
+ if (e.Key == Key.Back)
|
|
|
{
|
|
|
text_Code6.Text = "";
|
|
|
text_Code5.Focus();
|
|
|
+ text_Code5.Select(text_Code5.Text.Length, 0);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
|
+ {
|
|
|
+ e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
|
|
|
+ }
|
|
|
}
|
|
|
}
|