Пример #1
0
        private void btnNueva_Click(object sender, EventArgs e)
        {
            frmPelicula form = new frmPelicula();

            form.Text = "Nueva";

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Pelicula p = form.PeliculaActual;

                db.Peliculas.Add(p);
                db.SaveChanges();

                this.CargaGrid();
            }
        }
Пример #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            C1.Win.C1FlexGrid.Row r = fgPelis.Rows[fgPelis.RowSel];

            if (r.UserData is Pelicula)
            {
                Pelicula p = (Pelicula)r.UserData;

                frmPelicula form = new frmPelicula(p);
                form.Text = "Editar";

                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    db.SaveChanges();

                    this.CargaGrid();
                }
            }
            else
            {
                MessageBox.Show("Primero selecciona la película que quieres editar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #3
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            C1.Win.C1FlexGrid.Row r = fgPelis.Rows[fgPelis.RowSel];

            if (r.UserData is Pelicula)
            {
                Pelicula p = (Pelicula)r.UserData;

                frmPelicula form = new frmPelicula(p);
                form.Text = "Editar";

                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    db.SaveChanges();

                    this.CargaGrid();
                }
            }
            else
            {
                MessageBox.Show("Primero selecciona la película que quieres editar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #4
0
        private void btnNueva_Click(object sender, EventArgs e)
        {
            frmPelicula form = new frmPelicula();
            form.Text = "Nueva";

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Pelicula p = form.PeliculaActual;

                db.Peliculas.Add(p);
                db.SaveChanges();

                this.CargaGrid();
            }
        }