Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                Data.ClientID = textBox1.Text.Trim();

                clientsAll clients = new clientsAll();
                clients.MdiParent = main.ActiveForm;
                clients.Show();

                clients.clientsSearchId(Data.ClientID);
            }
            else if (textBox2.Text != "")
            {
                Data.ClientLastName = textBox2.Text.Trim();

                clientsAll clients = new clientsAll();
                clients.MdiParent = main.ActiveForm;
                clients.Show();

                clients.clientsSearchLastName(Data.ClientLastName);
            }
            else
            {
                MessageBox.Show("You need to enter Client's Id or Client's Last Name");
                return;
            }
        }
Beispiel #2
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                try
                {
                    if (textBox1.Text != "")
                    {
                        Data.ClientID = textBox1.Text.Trim();

                        clientsAll clients = new clientsAll();
                        clients.MdiParent = main.ActiveForm;
                        clients.Show();

                        clients.clientsSearchId(Data.ClientID);
                    }
                    else
                    {
                        MessageBox.Show("You need to enter Client's Id");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }