Ejemplo n.º 1
0
        private void Apanel_b_Click(object sender, EventArgs e)
        {
            admin_form admin_panel = new admin_form();

            admin_panel.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void autho_button_Click(object sender, EventArgs e)
        {
            string text = this.authorizate_text_box.Text;

            authorizate_text_box.Text = "";

            if (text != "admin")
            {
                try{
                    int       number = Convert.ToInt32(text);
                    telephone _phone = test.data.get_phone(number);
                    if (_phone != null)
                    {
                        if (used_numbers.Contains(number))
                        {
                            MessageBox.Show("This number is used now", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }

                        else
                        {
                            used_numbers.Add(number);
                            phone phone_form = new phone(_phone);
                            phone_form.Show();
                            this.Visible = false;
                        }
                    }

                    else
                    {
                        MessageBox.Show("This number dont exsist", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                catch (FormatException ex) {
                    MessageBox.Show("This is not nubmer", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            else
            {
                if (is_admin)
                {
                    MessageBox.Show("There is another admin exsist", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                else
                {
                    is_admin = true;
                    admin_form admin = new admin_form();
                    admin.Show();
                }
            }
        }