示例#1
0
        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView2[e.ColumnIndex, e.RowIndex] is DataGridViewButtonCell)
            {
                try
                {
                    int idImprumut = Int32.Parse((string)dataGridView2["IdImprumut", e.RowIndex].Value);
                    PersonalDataAcces.ReturneazaCarte(idImprumut, SqlDataAcces.ConnectionString);

                    _imprumutri = PersonalDataAcces.GetAllLaondsByUserId(_selectedUser.ID, SqlDataAcces.ConnectionString);
                    InitiateCititor(_selectedUser);
                }
                catch { }
            }
        }
示例#2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int row    = e.RowIndex;
            int column = e.ColumnIndex;

            if (dataGridView1.Rows[row].Cells[column] is DataGridViewButtonCell)
            {
                int userId = Int32.Parse((string)dataGridView1.Rows[row].Cells["IdCititor"].Value);
                _selectedUser = utilizatori.Find(x => x.ID == userId);

                IsEnabled   = true;
                _imprumutri = PersonalDataAcces.GetAllLaondsByUserId(_selectedUser.ID, SqlDataAcces.ConnectionString);
                _rezervari  = PersonalDataAcces.GetAllRezervarationByUserId(_selectedUser.ID, SqlDataAcces.ConnectionString);
                InitiateCititor(_selectedUser);
                tabControl1.SelectedIndex++;
            }
        }