Esempio n. 1
0
        private async void JoinClicked(object sender, RoutedEventArgs e)
        {
            (sender as Button).IsEnabled = false;

            optionsView.IsHitTestVisible = false;
            var optionCenterY = (float)optionsView.DesiredSize.Height / 2;
            var optionCenterX = (float)optionsView.DesiredSize.Width / 2;

            optionsView.Scale(0.8f, 0.8f, optionCenterX, optionCenterY).Fade(0).Start();


            var joinCenterY = (float)joinSection.DesiredSize.Height / 2;
            var joinCenterX = (float)joinSection.DesiredSize.Width / 2;

            joinSection.IsHitTestVisible = true;
            await joinSection.Scale(1.2f, 1.2f, joinCenterX, joinCenterY, 0)
            .Then().Scale(1, 1, joinCenterX, joinCenterY).Fade(1).StartAsync();

            CodeTextBox.Focus(FocusState.Keyboard);

            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;

            (sender as Button).IsEnabled = true;
        }
Esempio n. 2
0
        private async void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
        {
            errorBox.Opacity = 0;
            if (e.Key == Windows.System.VirtualKey.Back)
            {
                return;
            }


            if (CodeTextBox.Text.Count() == 6)
            {
                // join party
                CodeTextBox.IsEnabled = false;
                ShowLoading("joining party");
                if (await DataService.Instance.InitDataServiceAsClient(CodeTextBox.Text))
                {
                    Frame.Navigate(typeof(MainPage), false);
                }
                else
                {
                    HideLoading();
                    CodeTextBox.IsEnabled = true;
                    CodeTextBox.Focus(FocusState.Keyboard);
                    errorBox.Opacity = 1;
                    errorBox.Offset(10).Then().Offset(-10).Then().Offset(10).Then().Offset(-10).Then().Offset(0).SetDurationForAll(30).Start();
                }
            }
            else if (CodeTextBox.Text.Count() > 6)
            {
                CodeTextBox.Text = CodeTextBox.Text.Substring(0, 6);
                e.Handled        = true;
                CodeTextBox.Select(6, 0);
            }
        }
Esempio n. 3
0
        private async void SendCode_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.ShowError = false;
            if (!Regex.IsMatch(ViewModel.Mobile, @"^\d{7,}$"))
            {
                ViewModel.ErrorText = "手机号输入格式不正确";
                ViewModel.ShowError = true;
            }
            else if (string.IsNullOrEmpty(ViewModel.ImageCode))
            {
                ViewModel.ErrorText = "请输入图片验证码";
                ViewModel.ShowError = true;
            }
            else
            {
                await ViewModel.SendCodeAsync();

                if (ViewModel.ShowError)
                {
                    ImageButton_Click(sender, e);
                    ImageCodeTextBox.Focus(FocusState.Programmatic);
                }
                else
                {
                    CodeTextBox.Focus(FocusState.Programmatic);
                }
            }
        }
 public void Clean()
 {
     CodeTextBox.Text        = string.Empty;
     DescriptionTextBox.Text = string.Empty;
     PriceTextBox.Text       = string.Empty;
     CodeTextBox.Focus();
 }
Esempio n. 5
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            var n = new TabPage()
            {
                Text = "Query" + (tabControl1.Controls.Count + 1),
            };

            CodeTextBox c = new CodeTextBox()
            {
                AutoWordSelection = true,
                BackColor         = Color.White,
                BorderStyle       = System.Windows.Forms.BorderStyle.None,
                Dock      = System.Windows.Forms.DockStyle.Fill,
                Font      = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))),
                ForeColor = Color.Black,
                Location  = new System.Drawing.Point(3, 3),
                Size      = new System.Drawing.Size(431, 225),
                Name      = "codeTextBox" + (tabControl1.Controls.Count + 1),
                TabIndex  = 1,
            };

            c.GotFocus += delegate
            {
                ActiveEditor = c;
            };
            c.KeyDown         += C_KeyDown;
            c.ContextMenuStrip = CodeEditorStrip1;
            n.Controls.Add(c);
            tabControl1.Controls.Add(n);
            tabControl1.SelectTab((tabControl1.Controls.Count - 1));
            c.Focus();
            ActiveEditor = c;
            //tabControl1.Controls;
        }
Esempio n. 6
0
 public MainWindow()
 {
     InitializeComponent();
     lineTemplate = LineCounterLabel.Content.ToString();
     Load();
     _ = Saving();
     CodeTextBox.Focus();
     RefreshLineCounter();
 }
 private void AddProductView_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         presenter = new AddProductPresenter(this);
         InvokeViewInitialized(EventArgs.Empty);
         CodeTextBox.Focus();
     }
 }
 public bool HandleKeypress(System.Windows.Forms.Keys key)
 {
     if (key == System.Windows.Forms.Keys.F1)
     {
         SampleGroupBindingSource.AddNew();
         CodeTextBox.Focus();
         return(true);
     }
     return(false);
 }
        private void OnCurrentSampleGroupChanged()
        {
            if (_currentSampleGroup != null)
            {
                _currentSampleGroup.PropertyChanged += _currentSampleGroup_PropertyChanged;

                CodeTextBox.Focus();
            }

            panel3.Enabled = CurrentSampleGroup != null;
            UpdateTreeDefaults();
            TreeDefaultGridView.SelectedItems = CurrentSampleGroup?.TreeDefaultValues;
        }
Esempio n. 10
0
        internal void ShowIntellisenseBoxWithoutUpdate()
        {
            if (m_CodeTextBox.IntellisenseTree == null)
            {
                return;
            }

            //our box has some elements, choose the first
            try
            {
                m_CodeTextBox.IntellisenseBox.SelectedIndex = 0;
            }
            catch { }


            //Get top-left coordinate for our intellisenseBox
            Point topLeft = m_CodeTextBox.GetPositionFromCharIndex(m_CodeTextBox.SelectionStart);

            topLeft.Offset(-35, 18);

            #region Place the intellisense box, to fit the space...
            if (m_CodeTextBox.Size.Height < (topLeft.Y + m_CodeTextBox.IntellisenseBox.Height))
            {
                topLeft.Offset(0, -18 - 18 - m_CodeTextBox.IntellisenseBox.Height);
            }

            if (m_CodeTextBox.Size.Width < (topLeft.X + m_CodeTextBox.IntellisenseBox.Width))
            {
                topLeft.Offset(35 + 15 - m_CodeTextBox.IntellisenseBox.Width, 0);
            }

            if (topLeft.X < 0)
            {
                topLeft.X = 0;
            }

            if (topLeft.Y < 0)
            {
                topLeft.Y = 0;
            }
            #endregion

            m_CodeTextBox.IntellisenseBox.Location = topLeft;
            m_CodeTextBox.IntellisenseBox.Visible  = true;
            m_CodeTextBox.Focus();
        }
Esempio n. 11
0
        private void ShowData()
        {
            if (String.IsNullOrEmpty(CodeTextBox.Text) && String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه و كود الفئه ");
                CodeTextBox.Focus();
            }
            else if (String.IsNullOrEmpty(CodeTextBox.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه");
                CodeTextBox.Focus();
            }
            else if (CodeTextBox.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه بشكل صحيح");
                CodeTextBox.Focus();
            }
            else if (String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الفئه");
                textBox3.Focus();
            }
            else if (textBox3.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل كود الفئه بشكل صحيح");
                textBox3.Focus();
            }
            else if (textBox2.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم الجهه بشكل صحيح");
                textBox2.Focus();
            }
            else if (textBox4.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم الفئه بشكل صحيح");
                textBox4.Focus();
            }
            else
            {
                if (comboBox1.Text != null)
                {
                    if (comboBox1.Text == "مراجع")
                    {
                        try
                        {
                            con.OpenConection();
                            //not find table [0]
                            string[]    pramname  = new string[4];
                            string[]    pramvalue = new string[4];
                            SqlDbType[] pramtype  = new SqlDbType[4];
                            pramname[0] = "@x1";
                            pramname[1] = "@x2";
                            pramname[2] = "@x3";
                            pramname[3] = "@x4";

                            pramvalue[0] = CodeTextBox.Text;
                            pramvalue[1] = textBox3.Text;
                            pramvalue[2] = dateTimePicker1.Value.ToString();
                            pramvalue[3] = dateTimePicker2.Value.ToString();

                            pramtype[0] = SqlDbType.Int;
                            pramtype[1] = SqlDbType.Int;
                            pramtype[2] = SqlDbType.VarChar;
                            pramtype[3] = SqlDbType.VarChar;

                            dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_bill_patientT", pramname, pramvalue, pramtype);
                            //MessageBox.Show("");
                            con.CloseConnection();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                        }
                    }
                }

                else
                {
                    try
                    {
                        con.OpenConection();
                        //not find table [0]
                        string[]    pramname  = new string[4];
                        string[]    pramvalue = new string[4];
                        SqlDbType[] pramtype  = new SqlDbType[4];
                        pramname[0] = "@x1";
                        pramname[1] = "@x2";
                        pramname[2] = "@x3";
                        pramname[3] = "@x4";

                        pramvalue[0] = CodeTextBox.Text;
                        pramvalue[1] = textBox3.Text;
                        pramvalue[2] = dateTimePicker1.Value.ToString();
                        pramvalue[3] = dateTimePicker2.Value.ToString();

                        pramtype[0] = SqlDbType.Int;
                        pramtype[1] = SqlDbType.Int;
                        pramtype[2] = SqlDbType.VarChar;
                        pramtype[3] = SqlDbType.VarChar;

                        dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_bill_patientF", pramname, pramvalue, pramtype);
                        //MessageBox.Show("");
                        con.CloseConnection();
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                    }
                }
            }
        }