예제 #1
0
        private void ListaDeIntegrantesbarButtonItem_ItemClick(object sender, ItemClickEventArgs e)
        {
            var form = FindControl("ArtistasForm") as XtraForm;

            if (form != null)
            {
                form.Activate();
            }
            else
            {
                ArtistasForm integrantesForm = new ArtistasForm {
                    MdiParent = this
                };
                integrantesForm.Show();
                //Dispose();
            }
        }
예제 #2
0
        private void Insertar_simpleButton_Click(object sender, EventArgs e)
        {
            //ArtistasForm ListadoArtista = new ArtistasForm(_GlobalActividad.AgrupacionId);

            int          nombreGrupo     = Convert.ToInt32(AGlobalActividad.AgrupacionId);
            ArtistasForm integrantesForm = new ArtistasForm(nombreGrupo);

            integrantesForm.InsertInegrante_buttonEdit.Visible = true;
            // _IntegrantesForm.SelectGroup(_GrupoId);
            if (integrantesForm.ShowDialog() == DialogResult.OK &&
                integrantesForm.Artista_gridView.GetSelectedRows().Count() > 0)
            {
                // List<Artista> _Artistas = new List<Artista>();
                var selectedRows = integrantesForm.Artista_gridView.GetSelectedRows();
                foreach (var selectedRow in selectedRows)
                {
                    Artista artista =
                        ((AgrupacionDeArtista)(integrantesForm.Artista_gridView.GetRow(selectedRow))).Artista;
                    if (!AGlobalDataContext.ParticipantesDeAcividad.Any(
                            c => c.ActividadId == AGlobalActividad.OrdenDeTrabajoID &&
                            c.ArtistaId == artista.ArtistaID))
                    {
                        AGlobalDataContext.ParticipantesDeAcividad.InsertOnSubmit(new ParticipantesDeAcividad
                        {
                            ActividadId = AGlobalActividad.OrdenDeTrabajoID,
                            ArtistaId   = artista.ArtistaID
                        });
                    }
                    //  _Artistas.Add(_AgrupacionDeArtista.Artista);
                }
                //var _NuevosParticipantes = _Artistas.Select(c => c.ToParticipante(GetProyectoId(), _Configuracion.Agencia))
                //                .ToList();
                //        _GlobalDataContext.ParticipantesDeProyectos.InsertAllOnSubmit(_NuevosParticipantes);
                AGlobalDataContext.SubmitChanges();
                PopulaParticipantesGridControl();
            }
        }