Esempio n. 1
0
        private bool ExisteEnLaBaseDeDatos()
        {
            repos = new RepositorioBase <TipoEditorial>(new DAL.Contexto());
            TipoEditorial tipo = repos.Buscar((int)IDEditorialnumericUpDown.Value);

            return(tipo != null);
        }
Esempio n. 2
0
 private void LlenaCampo(TipoEditorial tipo)
 {
     IDEditorialnumericUpDown.Value = tipo.EditarialID;
     NombretextBox.Text             = tipo.Nombre;
     DireccionTextBox.Text          = tipo.Dirrecion;
     FechadateTimePicker.Value      = tipo.Fecha;
 }
Esempio n. 3
0
        private TipoEditorial LlenaClase()
        {
            TipoEditorial tipo = new TipoEditorial()
            {
                EditarialID = Convert.ToInt32(IDEditorialnumericUpDown.Value),
                Nombre      = NombretextBox.Text,
                Dirrecion   = DireccionTextBox.Text,
                Fecha       = FechadateTimePicker.Value
            };

            return(tipo);
        }
Esempio n. 4
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            repos = new RepositorioBase <TipoEditorial>(new Contexto());
            int.TryParse(IDEditorialnumericUpDown.Text, out int id);
            TipoEditorial tipos = new TipoEditorial();

            tipos = repos.Buscar(id);

            if (tipos != null)
            {
                MessageBox.Show("Editorial Encontrado.!!", "Exito!!!", MessageBoxButtons.OK);
                LlenaCampo(tipos);
            }
            else
            {
                MessageBox.Show("Editorial no Encontrada", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }