コード例 #1
0
        private void SessionClose_input_GotFocus(object sender, RoutedEventArgs e)
        {
            TextBox s_text_input = sender as TextBox;

            SessionClose_input_GotFocus_field = s_text_input.Name;

            switch (SessionClose_input_GotFocus_field)
            {
            case "SessionClose_card_input":
                SessionClose_card_input.Select(SessionClose_card_input.Text.Length, 0);
                break;

            case "SessionClose_500x_input":
                SessionClose_500x_input.Select(SessionClose_500x_input.Text.Length, 0);
                break;

            case "SessionClose_100x_input":
                SessionClose_100x_input.Select(SessionClose_100x_input.Text.Length, 0);
                break;

            case "SessionClose_50x_input":
                SessionClose_50x_input.Select(SessionClose_50x_input.Text.Length, 0);
                break;

            case "SessionClose_10x_input":
                SessionClose_10x_input.Select(SessionClose_10x_input.Text.Length, 0);
                break;

            case "SessionClose_5x_input":
                SessionClose_5x_input.Select(SessionClose_5x_input.Text.Length, 0);
                break;

            case "SessionClose_1x_input":
                SessionClose_1x_input.Select(SessionClose_1x_input.Text.Length, 0);
                break;

            case "SessionClose_50dx_input":
                SessionClose_50dx_input.Select(SessionClose_50dx_input.Text.Length, 0);
                break;

            case "SessionClose_25dx_input":
                SessionClose_25dx_input.Select(SessionClose_25dx_input.Text.Length, 0);
                break;

            case "SessionClose_only_total_input":
                SessionClose_only_total_input.Select(SessionClose_only_total_input.Text.Length, 0);
                break;

            default:
                break;
            }
        }
コード例 #2
0
        private void SessionClose_input_TextChanged(object sender, TextChangedEventArgs e)
        {
            switch (SessionClose_input_GotFocus_field)
            {
            case "SessionClose_card_input":
                SessionClose_card_input.Select(SessionClose_card_input.Text.Length, 0);
                break;

            case "SessionClose_500x_input":
                SessionClose_500x_input.Select(SessionClose_500x_input.Text.Length, 0);
                break;

            case "SessionClose_100x_input":
                SessionClose_100x_input.Select(SessionClose_100x_input.Text.Length, 0);
                break;

            case "SessionClose_50x_input":
                SessionClose_50x_input.Select(SessionClose_50x_input.Text.Length, 0);
                break;

            case "SessionClose_10x_input":
                SessionClose_10x_input.Select(SessionClose_10x_input.Text.Length, 0);
                break;

            case "SessionClose_5x_input":
                SessionClose_5x_input.Select(SessionClose_5x_input.Text.Length, 0);
                break;

            case "SessionClose_1x_input":
                SessionClose_1x_input.Select(SessionClose_1x_input.Text.Length, 0);
                break;

            case "SessionClose_50dx_input":
                SessionClose_50dx_input.Select(SessionClose_50dx_input.Text.Length, 0);
                break;

            case "SessionClose_25dx_input":
                SessionClose_25dx_input.Select(SessionClose_25dx_input.Text.Length, 0);
                break;

            case "SessionClose_only_total_input":
                SessionClose_only_total_input.Select(SessionClose_only_total_input.Text.Length, 0);
                break;

            default:
                break;
            }
        }
コード例 #3
0
        private void SessionClose_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            switch (SessionClose_input_GotFocus_field)
            {
            case "SessionClose_card_input":
                Keyboard.Focus(SessionClose_card_input);
                SessionClose_card_input.Select(SessionClose_card_input.Text.Length, 0);
                break;

            case "SessionClose_500x_input":
                Keyboard.Focus(SessionClose_500x_input);
                SessionClose_500x_input.Select(SessionClose_500x_input.Text.Length, 0);
                break;

            case "SessionClose_100x_input":
                Keyboard.Focus(SessionClose_100x_input);
                SessionClose_100x_input.Select(SessionClose_100x_input.Text.Length, 0);

                break;

            case "SessionClose_50x_input":
                Keyboard.Focus(SessionClose_50x_input);
                SessionClose_50x_input.Select(SessionClose_50x_input.Text.Length, 0);

                break;

            case "SessionClose_10x_input":
                Keyboard.Focus(SessionClose_10x_input);
                SessionClose_10x_input.Select(SessionClose_10x_input.Text.Length, 0);

                break;

            case "SessionClose_5x_input":
                Keyboard.Focus(SessionClose_5x_input);
                SessionClose_5x_input.Select(SessionClose_5x_input.Text.Length, 0);

                break;

            case "SessionClose_1x_input":
                Keyboard.Focus(SessionClose_1x_input);
                SessionClose_1x_input.Select(SessionClose_1x_input.Text.Length, 0);

                break;

            case "SessionClose_50dx_input":
                Keyboard.Focus(SessionClose_50dx_input);
                SessionClose_50dx_input.Select(SessionClose_50dx_input.Text.Length, 0);

                break;

            case "SessionClose_25dx_input":
                Keyboard.Focus(SessionClose_25dx_input);
                SessionClose_25dx_input.Select(SessionClose_25dx_input.Text.Length, 0);

                break;

            case "SessionClose_only_total_input":
                Keyboard.Focus(SessionClose_only_total_input);
                SessionClose_only_total_input.Select(SessionClose_only_total_input.Text.Length, 0);

                break;

            default:
                break;
            }
        }
コード例 #4
0
        private void SessionClose_KeyPadErase_Click(object sender, RoutedEventArgs e)
        {
            if (SessionClose_input_GotFocus_field == "SessionClose_card_input" && SessionClose_card_input.Text != String.Empty)
            {
                SessionClose_card_input.Text = SessionClose_card_input.Text.Remove(SessionClose_card_input.Text.Length - 1);
                if (SessionClose_card_input.Text == String.Empty)
                {
                    SessionClose_card_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_card_total.Text = Convert.ToDouble(SessionClose_card_input.Text).ToString("0.00");
                SessionClose_card_input.Select(SessionClose_card_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_500x_input" && SessionClose_500x_input.Text != String.Empty)
            {
                SessionClose_500x_input.Text = SessionClose_500x_input.Text.Remove(SessionClose_500x_input.Text.Length - 1);
                if (SessionClose_500x_input.Text == String.Empty)
                {
                    SessionClose_500x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_500x_total.Text = (Convert.ToDouble(SessionClose_500x_input.Text) * 500).ToString("0.00");

                //SessionClose_500x_total.Text = (Convert.ToDouble(SessionClose_500x_input.Text) * 25).ToString("0.00");
                SessionClose_500x_input.Select(SessionClose_500x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_100x_input" && SessionClose_100x_input.Text != String.Empty)
            {
                SessionClose_100x_input.Text = SessionClose_100x_input.Text.Remove(SessionClose_100x_input.Text.Length - 1);
                if (SessionClose_100x_input.Text == String.Empty)
                {
                    SessionClose_100x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_100x_total.Text = (Convert.ToDouble(SessionClose_100x_input.Text) * 100).ToString("0.00");
                SessionClose_100x_input.Select(SessionClose_100x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_50x_input" && SessionClose_50x_input.Text != String.Empty)
            {
                SessionClose_50x_input.Text = SessionClose_50x_input.Text.Remove(SessionClose_50x_input.Text.Length - 1);
                if (SessionClose_50x_input.Text == String.Empty)
                {
                    SessionClose_50x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_50x_total.Text = (Convert.ToDouble(SessionClose_50x_input.Text) * 50).ToString("0.00");
                SessionClose_50x_input.Select(SessionClose_50x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_10x_input" && SessionClose_10x_input.Text != String.Empty)
            {
                SessionClose_10x_input.Text = SessionClose_10x_input.Text.Remove(SessionClose_10x_input.Text.Length - 1);
                if (SessionClose_10x_input.Text == String.Empty)
                {
                    SessionClose_10x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_10x_total.Text = (Convert.ToDouble(SessionClose_10x_input.Text) * 10).ToString("0.00");
                SessionClose_10x_input.Select(SessionClose_10x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_5x_input" && SessionClose_5x_input.Text != String.Empty)
            {
                SessionClose_5x_input.Text = SessionClose_5x_input.Text.Remove(SessionClose_5x_input.Text.Length - 1);
                if (SessionClose_5x_input.Text == String.Empty)
                {
                    SessionClose_5x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_5x_total.Text = (Convert.ToDouble(SessionClose_5x_input.Text) * 5).ToString("0.00");
                SessionClose_5x_input.Select(SessionClose_5x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_1x_input" && SessionClose_1x_input.Text != String.Empty)
            {
                SessionClose_1x_input.Text = SessionClose_1x_input.Text.Remove(SessionClose_1x_input.Text.Length - 1);
                if (SessionClose_1x_input.Text == String.Empty)
                {
                    SessionClose_1x_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_1x_total.Text = (Convert.ToDouble(SessionClose_1x_input.Text) * 1).ToString("0.00");
                SessionClose_1x_input.Select(SessionClose_1x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_50dx_input" && SessionClose_50dx_input.Text != String.Empty)
            {
                SessionClose_50dx_input.Text = SessionClose_50dx_input.Text.Remove(SessionClose_50dx_input.Text.Length - 1);
                if (SessionClose_50dx_input.Text == String.Empty)
                {
                    SessionClose_50dx_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_50dx_total.Text = (Convert.ToDouble(SessionClose_50dx_input.Text) * 50).ToString("0.00");
                SessionClose_50dx_input.Select(SessionClose_50dx_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_25dx_input" && SessionClose_25dx_input.Text != String.Empty)
            {
                SessionClose_25dx_input.Text = SessionClose_25dx_input.Text.Remove(SessionClose_25dx_input.Text.Length - 1);
                if (SessionClose_25dx_input.Text == String.Empty)
                {
                    SessionClose_25dx_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_25dx_total.Text = (Convert.ToDouble(SessionClose_25dx_input.Text) * 25).ToString("0.00");
                SessionClose_25dx_input.Select(SessionClose_25dx_input.Text.Length, 0);
                SessionClose_grand_total_cal();
            }
            if (SessionClose_input_GotFocus_field == "SessionClose_only_total_input" && SessionClose_only_total_input.Text != String.Empty)
            {
                SessionClose_only_total_input.Text = SessionClose_only_total_input.Text.Remove(SessionClose_only_total_input.Text.Length - 1);
                if (SessionClose_only_total_input.Text != String.Empty)
                {
                    SessionClose_only_total_total.Text = "0.00";
                    SessionClose_grand_total_cal();
                    return;
                }
                SessionClose_only_total_total.Text = Convert.ToDouble(SessionClose_only_total_input.Text).ToString("0.00");
                SessionClose_only_total_input.Select(SessionClose_only_total_input.Text.Length, 0);
                SessionClose_grand_total.Text = SessionClose_only_total_input.Text;
            }
        }
コード例 #5
0
        private void SessionClose_KeyPad_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (Button)e.OriginalSource;

            string s = btn.Content.ToString();

            switch (SessionClose_input_GotFocus_field)
            {
            case "SessionClose_card_input":
                SessionClose_card_input.Text += s;

                SessionClose_card_total.Text = Convert.ToDouble(SessionClose_card_input.Text).ToString("0.00");
                SessionClose_card_input.Select(SessionClose_card_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_500x_input":
                SessionClose_500x_input.Text += s;

                SessionClose_500x_total.Text = (Convert.ToDouble(SessionClose_500x_input.Text) * 500).ToString("0.00");
                SessionClose_500x_input.Select(SessionClose_500x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_100x_input":
                SessionClose_100x_input.Text += s;

                SessionClose_100x_total.Text = (Convert.ToDouble(SessionClose_100x_input.Text) * 100).ToString("0.00");
                SessionClose_100x_input.Select(SessionClose_100x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_50x_input":
                SessionClose_50x_input.Text += s;

                SessionClose_50x_total.Text = (Convert.ToDouble(SessionClose_50x_input.Text) * 50).ToString("0.00");
                SessionClose_50x_input.Select(SessionClose_50x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_10x_input":
                SessionClose_10x_input.Text += s;

                SessionClose_10x_total.Text = (Convert.ToDouble(SessionClose_10x_input.Text) * 10).ToString("0.00");
                SessionClose_10x_input.Select(SessionClose_10x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_5x_input":
                SessionClose_5x_input.Text += s;

                SessionClose_5x_total.Text = (Convert.ToDouble(SessionClose_5x_input.Text) * 5).ToString("0.00");
                SessionClose_5x_input.Select(SessionClose_5x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_1x_input":
                SessionClose_1x_input.Text += s;

                SessionClose_1x_total.Text = (Convert.ToDouble(SessionClose_1x_input.Text) * 1).ToString("0.00");
                SessionClose_1x_input.Select(SessionClose_1x_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_50dx_input":
                SessionClose_50dx_input.Text += s;

                SessionClose_50dx_total.Text = (Convert.ToDouble(SessionClose_50dx_input.Text) * 50).ToString("0.00");
                SessionClose_50dx_input.Select(SessionClose_50dx_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_25dx_input":
                SessionClose_25dx_input.Text += s;

                SessionClose_25dx_total.Text = (Convert.ToDouble(SessionClose_25dx_input.Text) * 25).ToString("0.00");
                SessionClose_25dx_input.Select(SessionClose_25dx_input.Text.Length, 0);
                SessionClose_grand_total_cal();
                break;

            case "SessionClose_only_total_input":
                SessionClose_only_total_input.Text += s;
                SessionClose_only_total_input.Text  = SessionClose_only_total_input.Text;
                SessionClose_grand_total.Text       = SessionClose_only_total_input.Text;
                SessionClose_only_total_input.Select(SessionClose_only_total_input.Text.Length, 0);
                break;

            default:
                break;
            }
        }