private void tabbedControlGroup1_SelectedPageChanging(object sender, DevExpress.XtraLayout.LayoutTabPageChangingEventArgs e) { if (e.Page == Agrupaciones_layoutControlGroup) { if (artistaId == 0) //estoy insertando un nuevo artista { if (MessageBox.Show("Para asignarle una agrupación a un artista debe salvarlo antes, esta de acuerdo?", "Un momento...", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand) == DialogResult.OK) { artistaId = SalvarIntegrante(); bindingSource1.DataSource = AGlobalDataContext.AgrupacionDeArtista.Where(c => c.ArtistaId == artistaId); } else { e.Cancel = true; } } } else if (e.Page == Trayectoria_layoutControlGroup) { if (artistaId == 0) //estoy insertando un nuevo artista { if (MessageBox.Show("Para insertar la trayectoria de un artista debe salvarlo antes, esta de acuerdo?", "Un momento...", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand) == DialogResult.OK) { artistaId = SalvarIntegrante(); trayectoriaArtistaBindingSource.DataSource = AGlobalDataContext.TrayectoriaArtista.Where(c => c.ArtistaId == artistaId); } else { e.Cancel = true; } } } }
private void tabbedControlGroup1_SelectedPageChanging(object sender, DevExpress.XtraLayout.LayoutTabPageChangingEventArgs e) { if (e.Page == Distribucion_layoutControlGroup) { decimal importeDistribuir = Convert.ToDecimal(ImporteDistribuirConDesc_textEdit.EditValue); if (importeDistribuir == 0) { MessageBox.Show("Por favor realice antes la descomposición", "Un momento", MessageBoxButtons.OK, MessageBoxIcon.Hand); ParaUAImporteSinDescuento_textEdit.Focus(); e.Cancel = true; } else { TotalDistribuir_textEdit.EditValue = importeDistribuir; TotalDistribuir_textEdit.Enabled = false; ActualizaDiferencia(); } } }