Exemplo n.º 1
0
        private void gunaButton5_Click(object sender, EventArgs e)
        {
            NewClient    newClient    = new NewClient();
            DialogResult dialogResult = new DialogResult();

            dialogResult = newClient.ShowDialog();
            UpdateClients();
        }
Exemplo n.º 2
0
        private void gunaButton1_Click(object sender, EventArgs e)
        {
            this.Hide();
            NewClient    newClient    = new NewClient();
            DialogResult dialogResult = new DialogResult();

            dialogResult = newClient.ShowDialog();
            this.Show();
        }
Exemplo n.º 3
0
        private void gunaButton6_Click(object sender, EventArgs e)
        {
            connection = new SqlConnection(connectionString);
            connection.Open();

            int index = 0;

            foreach (DataGridViewCell cell in AllDataGridView.SelectedCells)
            {
                index = cell.RowIndex;
            }
            string   a      = (AllDataGridView[0, index].Value.ToString());
            string   b      = (AllDataGridView[1, index].Value.ToString());
            string   c      = (AllDataGridView[2, index].Value.ToString());
            string   d      = (AllDataGridView[3, index].Value.ToString());
            string   ee     = (AllDataGridView[4, index].Value.ToString());
            string   f      = (AllDataGridView[5, index].Value.ToString());
            string   g      = (AllDataGridView[6, index].Value.ToString());
            int      h      = Convert.ToInt32((AllDataGridView[8, index].Value));
            int      i      = Convert.ToInt32((AllDataGridView[9, index].Value));
            DateTime date   = Convert.ToDateTime((AllDataGridView[7, index].Value));
            int      index1 = 0;

            foreach (DataGridViewCell cell in AllDataGridView.SelectedCells)
            {
                index1 = cell.RowIndex;
            }
            string query = $"select * from [user] join client on [User].ID_user=Client.Id_user";

            AllDataGridView.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            AllDataGridView.AllowUserToAddRows = false;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                adapter = new SqlDataAdapter(query, connection);

                dataSet = new DataSet();
                adapter.Fill(dataSet);
                AllDataGridView.DataSource = dataSet.Tables[0];
                connection.Close();
            }
            connection = new SqlConnection(connectionString);
            connection.Open();

            string choose_id = (AllDataGridView[0, index1].Value.ToString());

            UpdateClients();
            NewClient    newClient    = new NewClient(Convert.ToInt32(choose_id), a, b, c, d, ee, f, g, date, h, i);
            DialogResult dialogResult = new DialogResult();

            dialogResult = newClient.ShowDialog();
            UpdateClients();
        }