Exemple #1
0
        private void B_AddAcc_Click(object sender, EventArgs e)
        {
            AuthForm authForm = new AuthForm(listApi);

            authForm.ShowDialog();
            UpdateNewAcc();
        }
Exemple #2
0
        public void closeForm()
        {
            AuthForm reg = new AuthForm();

            //Вызываем метод Show класс RegForm
            reg.Show();
            //Закрываем текущую форму
            this.Hide();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    errors     = 0;
            string outMessage = "";

            if (textBox1.Text == "")
            {
                errors++;
                outMessage = outMessage + errors.ToString() + " )Enter Name\n ";
            }
            if (textBox2.Text == "")
            {
                errors++;
                outMessage = outMessage + errors.ToString() + " )Enter Login\n ";
            }
            if (textBox3.Text == "")
            {
                errors++;
                outMessage = outMessage + errors.ToString() + " )Enter Adres\n ";
            }
            if (textBox4.Text == "")
            {
                errors++;
                outMessage = outMessage + errors.ToString() + " )Enter Password\n ";
            }
            if (!textBox4.Text.Equals(textBox5.Text))
            {
                errors++;
                outMessage = outMessage + errors.ToString() + " )Enter Password do match\n ";
            }
            if (errors == 0)
            {
                connection.Open();
                try
                {
                    rrr = new AuthForm();
                    SqlCommand cmd = new SqlCommand("INSERT INTO users (login,name,address,pass) VALUES (@login, @name, @address, @pass)", connection);
                    cmd.Parameters.AddWithValue("@login", textBox1.Text);
                    cmd.Parameters.AddWithValue("@name", textBox2.Text);
                    cmd.Parameters.AddWithValue("@address", textBox3.Text);
                    cmd.Parameters.AddWithValue("@pass", rrr.md5(textBox4.Text));
                    int regged = Convert.ToInt32(cmd.ExecuteNonQuery());
                    connection.Close();
                    MessageBox.Show("You have succesfully registred");
                }
                catch
                {
                    MessageBox.Show("User exists!");
                }
            }
            else
            {
                MessageBox.Show("There are mistakes!\n" + outMessage);
            }
        }
Exemple #4
0
        private void OpenPanel(string type)
        {
            AuthForm authForm = new AuthForm(type);

            authForm.ShowDialog();

            switch (GlobalProperties.user_id)
            {
            case "1":
                AdminPanel adminPanel = new AdminPanel();
                adminPanel.ShowDialog();
                break;

            case "2":
                ManagerPanel managerPanel = new ManagerPanel();
                managerPanel.ShowDialog();
                break;

            case "3":
                ClientPanel clientPanel = new ClientPanel();
                clientPanel.ShowDialog();
                break;
            }
        }
Exemple #5
0
 public OrdersList(AuthForm a, int cid)
 {
     InitializeComponent();
     this.authform = a;
     this.userid   = cid;
 }