Exemple #1
0
        private void button_ekledoktor_Click(object sender, EventArgs e)
        {
            DataGridView Dtg2      = Items.panelHastaneDoktor.dataGridUst;
            DataGridView Dtg       = Items.panelHastaneDoktor.dataGridAlt;
            Add_Doktor   addDoktor = new Add_Doktor()
            {
                isUpdate           = false,
                _Select_hastane_id = Dtg2.Rows[Dtg2.CurrentCell.RowIndex].Cells["ID"].Value.ToString()
            };

            addDoktor.ShowDialog();
        }
        private void datagridview_doktor_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var          senderGrid = (DataGridView)sender;
            DataGridView Dtg2       = Items.panelHastaneDoktor.dataGridUst;
            DataGridView Dtg        = Items.panelHastaneDoktor.dataGridAlt;

            if (e.ColumnIndex == senderGrid.Columns["duzenle"].Index && e.RowIndex >= 0)
            {
                Add_Doktor addDoktor = new Add_Doktor()
                {
                    isUpdate           = true,
                    _Select_id         = Dtg.Rows[Dtg.CurrentCell.RowIndex].Cells["ID"].Value.ToString(),
                    _Select_ad         = Dtg.Rows[Dtg.CurrentCell.RowIndex].Cells["İsim"].Value.ToString(),
                    _Select_soyad      = Dtg.Rows[Dtg.CurrentCell.RowIndex].Cells["Soyisim"].Value.ToString(),
                    _Select_hastane_id = Dtg2.Rows[Dtg2.CurrentCell.RowIndex].Cells["ID"].Value.ToString(),
                    _selected_durum    = Dtg.Rows[Dtg.CurrentCell.RowIndex].Cells["Durumu"].Value.ToString(),
                };

                addDoktor.ShowDialog();
            }
        }