示例#1
0
        private void назадToolStripMenuItem_Click(object sender, EventArgs e) // кнопка назад
        {
            this.Hide();
            bd.Close();
            get_man get_mans = new get_man(man_id, bd);

            get_mans.Show();
        }
示例#2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) // переход к конкретному клиенту
 {
     if (e.ColumnIndex == 7 && e.RowIndex != -1)
     {
         if (check_dann.Enabled == true)
         {
             bd.Close();
             this.Hide();
             get_man get_man = new get_man(Convert.ToInt32(spicok_klient[0, e.RowIndex].Value), bd);
             get_man.Show();
         }
         else
         {
             MessageBox.Show("Данные еще не загрузились подождите");
         }
     }
 }
示例#3
0
        /*ТУТ ИНВЕНТарь*/


        private void button2_Click(object sender, EventArgs e) // кнопка изменить
        {
            for (int i = 0; i < table.Rows.Count; i++)
            {
                int        kolvo       = Convert.ToInt32(table[4, i].Value);
                SqlCommand update_rent = new SqlCommand("UPDATE rent SET kolbo_give_away = @kol WHERE Id = @ID ", bd);
                update_rent.Parameters.AddWithValue("kol", kolvo);
                update_rent.Parameters.AddWithValue("ID", table[0, i].Value);
                update_rent.ExecuteNonQuery();
                if (table[3, i].Value == table[4, i].Value)
                {
                    SqlCommand update_rent_check = new SqlCommand("UPDATE rent SET check_dolg = @check_dolg WHERE Id = @ID ", bd);
                    update_rent_check.Parameters.AddWithValue("check_dolg", 0);
                    update_rent_check.Parameters.AddWithValue("ID", table[0, i].Value);
                    update_rent_check.ExecuteNonQuery();
                }
            }
            this.Hide();
            bd.Close();
            get_man get_mans = new get_man(man_id, bd);

            get_mans.Show();
        }