Beispiel #1
0
        private void EditarToolStripButton_Click(object sender, EventArgs e)
        {
            if (DatosDataGridView.SelectedRows.Count == 0)
            {
                return;
            }

            DataGridViewRow r = DatosDataGridView.SelectedRows[0];
            TipoEnvase      p = (TipoEnvase)r.Tag;

            p = _servicio.GetTipoEnvasePorId(p.TipoEnvaseID);
            FrmTiposEnvasesAE frm = new FrmTiposEnvasesAE();

            frm.Text = "Editar TipoEnvase";
            frm.SetTipoEnvase(p);
            DialogResult dr = frm.ShowDialog(this);

            if (dr == DialogResult.OK)
            {
                try
                {
                    p = frm.GetTipoEnvase();
                    _servicio.Guardar(p);
                    SetearFila(r, p);
                    MessageBox.Show("Registro modificado");
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    throw;
                }
            }
        }
Beispiel #2
0
 private void NuevoToolStripButton_Click(object sender, EventArgs e)
 {
     FrmTiposEnvasesAE frm = new FrmTiposEnvasesAE(this)
     {
         Text = "Agregar TipoEnvase"
     };
     DialogResult dr = frm.ShowDialog(this);
 }