コード例 #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dvBarrio.CurrentRow != null)
            {
                try
                {
                    DialogResult res = MessageBox.Show("Seguro de Editar el registro?", "Atencion!!!",
                                                       MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (res == DialogResult.No)
                    {
                        return;
                    }
                    FormEditarPremio frm = new FormEditarPremio();
                    var t = reglaPremio.getDatos(Int16.Parse(dvBarrio.CurrentRow.Cells[0].Value.ToString()));
                    frm.txtIdBarrio.Text    = t.idPremio.ToString();
                    frm.txtDescripcion.Text = t.leyenda;

                    frm.ShowDialog();
                    Lista(nom);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #2
0
        }//llena la grilla con premios

        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormEditarPremio frm = new FormEditarPremio();

            frm.nuevo = true;
            frm.ShowDialog();
            Lista(nom);
        }