private void NuevoIntegrante_simpleButton_Click(object sender, EventArgs e) { EditIntegrante_XtraForm _EditIntegrante_XtraForm = new EditIntegrante_XtraForm(); if (_EditIntegrante_XtraForm.ShowDialog() != DialogResult.Cancel) { PopulaIntegrantesGridControl(); } }
private void Artista_gridView_Click(object sender, EventArgs e) { var gridView = Artista_gridView; Point clickPoint = Integrantes_gridControl.PointToClient(MousePosition); var hitInfo = gridView.CalcHitInfo(clickPoint); if (hitInfo.InRowCell) { int rowHandle = hitInfo.RowHandle; GridColumn column = hitInfo.Column; Artista _Artista = (Artista)gridView.GetRow(rowHandle); // MessageBox.Show(column.Name + " "+rowHandle); if (column == colEdit_gridColumn) { EditIntegrante_XtraForm _EditIntegrante_XtraForm = new EditIntegrante_XtraForm(_Artista); if (_EditIntegrante_XtraForm.ShowDialog() == DialogResult.OK) { PopulaIntegrantesGridControl(); } } if (column == colBaja_gridColumn) { //if (gridView1.GetSelectedRows().Count() > 0) //{ Artista _Integrante = _GlobalDataContext.Artista.FirstOrDefault(c => c.ArtistaID == _Artista.ArtistaID); if (_Integrante.FechaDeBaja.HasValue) { if (MessageBox.Show("Este integrante está actualmente de baja, desea darle de Alta nuevamente?", "Atención", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { _Integrante.FechaDeBaja = null; _GlobalDataContext.SubmitChanges(); } } else { //determinar si el integrante no tiene ningun ingreso entonces solicitar que se borre if (MessageBox.Show("Al darle baja a este integrante no saldrá en más ninguna nómina, esta seguro?", "ESTA SEGURO?", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK) { if (!_Integrante.ParticipantesDeAcividad.Any() && !_Integrante.ParticipantesDeProyectos.Any()) { if (MessageBox.Show("El integrante no tiene ningún dato histórico registrado, desea borrarlo completamente?, tenga en cuenta que este proceso será irreversible", "Opción", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand) == DialogResult.OK) { //Artista_gridView.DeleteRow(rowHandle); _GlobalDataContext.Artista.DeleteOnSubmit(_Integrante); _GlobalDataContext.SubmitChanges(); PopulaIntegrantesGridControl(); return; } } PopupBajaXtraForm _BajaXtraForm = new PopupBajaXtraForm(_Integrante.ArtistaID); if (_BajaXtraForm.ShowDialog() != DialogResult.Cancel) { Integrantes_gridControl.DataSource = (new NegocioDataContext()).Artista.Where(c => !c.FechaDeBaja.HasValue); } } } // } } } }