Exemplo n.º 1
0
        public Animal MapearAAnimal()
        {
            Raza_Negocio  razaNegocio  = new Raza_Negocio();
            Tambo_Negocio tamboNegocio = new Tambo_Negocio();
            Raza          raza         = razaNegocio.RecuperarUno(Convert.ToInt32(cbRaza.SelectedValue));
            Tambo         tambo        = tamboNegocio.RecuperarPorNombre(txtTambo.Text);
            Animal        animal       = new Animal();

            animal.Rp = Convert.ToInt32(txtRP.Text);
            animal.Fecha_nacimiento = dtpFechaNacimiento.Value.Date;

            //animal.Foto = txtFoto.Text;
            animal.Nombre_animal = txtNombre.Text;
            animal.Estado_animal = cbEstado.SelectedItem.ToString();
            animal.Hba           = Convert.ToInt32(txtHBA.Text);
            animal.Id_Categoria  = ((Categoria)cbCategoria.SelectedItem).Id_Categoria;
            //animal.Sexo = cbSexo.SelectedItem.ToString();
            animal.Rp_madre   = Convert.ToInt32(txtRPMadre.Text);
            animal.Rp_padre   = Convert.ToInt32(txtRPPadre.Text);
            animal.Hba_madre  = Convert.ToInt32(txtHBAMadre.Text);
            animal.Hba_padre  = Convert.ToInt32(txtHBAPadre.Text);
            animal.Id_tambo   = tambo.Id_tambo;
            animal.Id_raza    = raza.Id_raza;
            animal.Habilitado = true;
            animal.Caravana   = txtCaravana.Text;

            return(animal);
        }
Exemplo n.º 2
0
        public Animal MapearAAnimal()
        {
            Raza_Negocio  razaNegocio  = new Raza_Negocio();
            Tambo_Negocio tamboNegocio = new Tambo_Negocio();
            Raza          raza         = razaNegocio.RecuperarUno(Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["id_raza"].Value));
            Tambo         tambo        = tamboNegocio.RecuperarUno(Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["id_tambo"].Value));
            Animal        animal       = new Animal();
            Categoria     categoria    = new Categoria();

            animal.Rp = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["rp"].Value);
            animal.Fecha_nacimiento = Convert.ToDateTime(this.dgvAnimales.CurrentRow.Cells["fecha_nacimiento"].Value);
            animal.Edad             = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["edad"].Value);
            animal.Nombre_animal    = Convert.ToString(this.dgvAnimales.CurrentRow.Cells["nombre_animal"].Value);
            animal.Estado_animal    = Convert.ToString(this.dgvAnimales.CurrentRow.Cells["estado_animal"].Value);
            animal.Hba            = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["hba"].Value);
            categoria.Descripcion = Convert.ToString(this.dgvAnimales.CurrentRow.Cells["categoria"].Value);
            //animal.Categoria.Descripcion = Convert.ToString(this.dgvAnimales.CurrentRow.Cells["categoria"].Value);
            animal.Nombre_tambo = tambo.Nombre_tambo;
            animal.Nombre_raza  = raza.Nombre_raza;
            animal.Id_raza      = raza.Id_raza;
            animal.Habilitado   = true;
            animal.Rp_madre     = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["rp_madre"].Value);
            animal.Hba_madre    = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["hba_madre"].Value);
            animal.Rp_padre     = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["rp_padre"].Value);
            animal.Hba_padre    = Convert.ToInt32(this.dgvAnimales.CurrentRow.Cells["hba_padre"].Value);
            animal.Caravana     = Convert.ToString(this.dgvAnimales.CurrentRow.Cells["caravana"].Value);

            return(animal);
        }
Exemplo n.º 3
0
 public ListaSeleccionAnimal(string modo)
 {
     InitializeComponent();
     modoGlobal       = modo;
     animalnegocio    = new Animal_Negocio();
     razanegocio      = new Raza_Negocio();
     categorianegocio = new Categoria_Negocio();
     Animal           = new Animal();
     CargarGrilla(modo);
 }
Exemplo n.º 4
0
 public GestionAnimales(int id_tambo)
 {
     InitializeComponent();
     Animal           = new Animal();
     razanegocio      = new Raza_Negocio();
     tambonegocio     = new Tambo_Negocio();
     categorianegocio = new Categoria_Negocio();
     controlNegocio   = new Control_Animal_Negocio();
     eventoNegocio    = new EventoAnimal_Negocio();
     CargarGrilla(id_tambo);
     CargarComboBusqueda();
     InicializarTextBox();
 }
Exemplo n.º 5
0
 public void CargarComboRaza()
 {
     try
     {
         Raza_Negocio razaNegocio = new Raza_Negocio();
         this.cbRaza.DataSource    = razaNegocio.RecuperarTodos();
         this.cbRaza.DisplayMember = "nombre_raza";
         this.cbRaza.ValueMember   = "id_raza";
         this.cbRaza.SelectedIndex = -1;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
     }
 }