private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn) { if (senderGrid.CurrentCell.OwningColumn.Name.ToString().Equals("HostEditButton")) { addConferenceDetailModel.ConferenceId = (int)dataGridView2.Rows[e.RowIndex].Cells["HostConferenceId"].Value; addConferenceDetailModel.ConferenceName = (string)dataGridView2.Rows[e.RowIndex].Cells["HostConferenceName"].Value; addConferenceDetailModel.ConferenceTypeName = (string)dataGridView2.Rows[e.RowIndex].Cells["HostType"].Value; addConferenceDetailModel.ConferenceCategoryName = (string)dataGridView2.Rows[e.RowIndex].Cells["HostCategory"].Value; addConferenceDetailModel.Location = (string)dataGridView2.Rows[e.RowIndex].Cells["HostAddress"].Value; addConferenceDetailModel.Speaker = (string)dataGridView2.Rows[e.RowIndex].Cells["HostMainSpeaker"].Value; addConferenceDetailModel.StartDate = (DateTime)dataGridView2.Rows[e.RowIndex].Cells["HostStartDate"].Value; addConferenceDetailModel.EndDate = (DateTime)dataGridView2.Rows[e.RowIndex].Cells["HostEndDate"].Value; AddEvent form3 = new AddEvent(0, f, addConferenceDetailModel, _GetSpeakerDetail, _ConferenceTypeRepository, _ConferenceRepository, _DictionaryCityRepository, _DictionaryCountryRepository, _DictionaryCountyRepository, _DictionaryConferenceCategoryRepository, _Locationrepository); this.Enabled = false; form3.Tag = this; form3.Show(this); } } } catch (Exception ex) { SetBalloonTip("Something is wrong", "Please press again!"); notifyIcon1.Visible = true; notifyIcon1.ShowBalloonTip(3000); } }
public void AddEventNotEdit() { AddEvent form3 = new AddEvent(1, f, addConferenceDetailModel, _GetSpeakerDetail, _ConferenceTypeRepository, _ConferenceRepository, _DictionaryCityRepository, _DictionaryCountryRepository, _DictionaryCountyRepository, _DictionaryConferenceCategoryRepository, _Locationrepository); this.Enabled = false; form3.Tag = this; form3.Show(this); }