Exemple #1
0
 public Persona(string nombre, int edad, string direccion, string Mnombre, int Medad, string Mraza)
 {
     Nombre = nombre;
     Edad = edad;
     Direccion = direccion;
     masco = new Mascota(Mnombre, Medad, Mraza);
 }
            public Dueño(string dNombre, string dApellido, int dEdad,string dDireccion, string dTelefono,string dNombreMascota,string dClase, string dRaza)
            {
                Nombre = dNombre;
                Apellido = dApellido;
                Edad = dEdad;
                Direccion = dDireccion;
                Telefono = dTelefono;

                MiMascota = new Mascota(dNombreMascota,dClase,dRaza);
            }
Exemple #3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            Mascota mascota = new Mascota();
            mascota.Id = int.Parse(txtId.Text);
            mascota.Nombre = txtNombreMascota.Text;
            mascota.NombreDueño = txtNombreDueno.Text;
            mascota.Raza = txtRazaMascota.Text;
            mascota.Tipo = txtTipoMascota.Text;

            Clinica clinica = (Clinica)Session["clinicaVeterinaria"];
            clinica.ListMascotas.Add(mascota);

            txtId.Text = "";
            txtNombreMascota.Text = "";
            txtNombreDueno.Text = "";
            txtRazaMascota.Text = "";
            txtTipoMascota.Text = "";
        }
Exemple #4
0
 public void Add(Mascota mascota)
 {
     context.Mascotas.Add(mascota);
 }
Exemple #5
0
        private void mascotaClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Mascota m = new Mascota();

            //m = (Mascota)e.Handled;
            if (userSpin.SelectedItemPosition == 1)
            {
                //que hacer si el usuario mantiene presionado un perro mientras mira la lista de perros que adopto
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Cancelar adopcion");
                alert.SetMessage("¿Poner nuevamente en adopcion la mascota?");
                alert.SetPositiveButton("CONFIRMAR", (senderAlert, args) => {
                    m            = mascotaAdapter.mascotas[e.Position];
                    m.estado     = Mascota.ESTADO_PUBLICADO;
                    m.user_adopt = 0;
                    conMas.editarMascota(m);
                    mascotaAdapter.mascotas.Remove(m);
                    mascotasList.Adapter = mascotaAdapter;
                });

                alert.SetNegativeButton("CANCELAR", (senderAlert, args) => {
                    //do Nothing;
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            }
            else if (userSpin.SelectedItemPosition == 2)
            {
                //que hacer si el usuario mantiene presionado un item mientras mira la lista de perros que subio
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Confirmar accion");
                alert.SetMessage("Elija que desea hacer con esta mascota");
                alert.SetPositiveButton("EDITAR", (senderAlert, args) =>
                {
                    Intent intent = new Intent(this, typeof(PerritoNuevo));
                    m             = mascotaAdapter.mascotas[e.Position];
                    intent.PutExtra("position", m.id_mas);
                    intent.PutExtra("username", user.username);
                    intent.PutExtra("access_token", user.access_token);
                    intent.PutExtra("nombre", user.nombre);
                    intent.PutExtra("roles", user.roles);
                    intent.PutExtra("id_user", user.id_user);

                    StartActivity(intent);
                });
                alert.SetNegativeButton("BORRAR", (senderAlert, args) => {
                    m = mascotaAdapter.mascotas[e.Position];
                    conMas.eliminarMascota(m);
                    mascotaAdapter.mascotas.Remove(m);
                });
                Dialog dialog = alert.Create();
                dialog.Show();
            }
            else
            {
                //que hacer si el usuario mantiene presionado un item mientras mira la lista de perros en adopcion
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Confirmar adopcion");
                alert.SetMessage("¿Queres adoptar a esta mascota?");
                Usuario owner = null;
                alert.SetPositiveButton("ADOPTAR", async(senderAlert, args) =>
                {
                    m     = mascotaAdapter.mascotas[e.Position];
                    owner = await conMas.adoptarMascota(m);
                    mascotaAdapter.mascotas.Remove(m);
                    mascotasList.Adapter = mascotaAdapter;
                    mostrarDueno(owner, m);
                });

                alert.SetNegativeButton("CANCELAR", (senderAlert, args) => {
                    //do Nothing;
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }
Exemple #6
0
        //BOTON CREAR NUEVO CLIENTE CON UNA MASCOTA
        private void BotonCrearClienteNuevo_Click(object sender, EventArgs e)
        {
            //Control casillas
            if (CajaNombreCliente.Text == "" || CajaRunCliente.Text == "" || CajaApellidosCliente.Text == "" || CajaCelularCliente.Text == "" ||
                CajaDireccionCliente.Text == "" || CajaNombreMascota.Text == "")
            {
                MessageBox.Show("Rellene las casillas.");
            }
            else
            {
                //Creo un cliente en primera instancia
                Cliente cli = new Cliente();
                cli.SetRutCliente(CajaRunCliente.Text);
                cli.SetNombreCliente(CajaNombreCliente.Text);
                cli.SetApellidosCliente(CajaApellidosCliente.Text);
                cli.SetFonoCliente(CajaFonoCliente.Text);
                cli.SetCelularCliente(CajaCelularCliente.Text);
                cli.SetDireccionCliente(CajaDireccionCliente.Text);

                ConsultasSecretaria conse = new ConsultasSecretaria();
                if (conse.RegistrarClienteSecretaria(cli))
                {
                    //Creado el cliente, se debe crear la mascota al usuario
                    //Por defecto, la mascota solo tendrá el nombre y la categoria correspondiente (), ya que los datos como estatura, edad y resto... se los agregará el
                    //veterinario

                    //Obtengo la id del cliente que se acaba de crer
                    ArrayList ares = new ArrayList();
                    ares = conse.ObtenerIdClienteSecretaria(CajaRunCliente.Text);

                    Mascota masc = new Mascota();
                    masc.SetIdCliente(Convert.ToInt32(ares[0]));
                    masc.SetNombreMascota(CajaNombreMascota.Text);
                    switch (CajaCategoriaMascota.Text)
                    {
                    case "ESCIÚRIDOS":
                        masc.SetIdCategoriaMascota(1);
                        break;

                    case "MÚRIDOS":
                        masc.SetIdCategoriaMascota(2);
                        break;

                    case "CRICÉTIDOS":
                        masc.SetIdCategoriaMascota(3);
                        break;

                    case "FÉLIDOS":
                        masc.SetIdCategoriaMascota(4);
                        break;

                    case "CÁNIDOS":
                        masc.SetIdCategoriaMascota(5);
                        break;

                    case "MUSTÉLIDOS":
                        masc.SetIdCategoriaMascota(6);
                        break;

                    case "GALLINÁCEAS":
                        masc.SetIdCategoriaMascota(7);
                        break;

                    case "TESTUDÍNIDOS":
                        masc.SetIdCategoriaMascota(8);
                        break;

                    case "TITÓNIDOS":
                        masc.SetIdCategoriaMascota(9);
                        break;
                    }
                    if (conse.RegistrarMascotaSecretaria(masc))
                    {
                        MessageBox.Show("Se ha registrado con exito el cliente y su mascota.");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Ha ocurrido un error. Intente nuevamente.");
                    }
                }
                else
                {
                    MessageBox.Show("Ha ocurrido un error. Intente nuevamente.");
                }
            }
        }
Exemple #7
0
 public Dueno(string nombrePersona, string direccionPersona, string NombreMascota, string TipoMascota)
 {
     NombrePersona    = nombrePersona;
     DireccionPersona = direccionPersona;
     mascota          = new Mascota(NombreMascota, TipoMascota);
 }
Exemple #8
0
 public int Edit(Mascota mascota)
 {
     _context.Entry(mascota).State = EntityState.Modified;
     _context.SaveChanges();
     return(1);
 }
Exemple #9
0
        public int D_registrar_mascota_ConFecha_esterilizado(Mascota masc)
        {
            String cadena = DConexion.cadena;
            String sql    = "INSERT INTO mascota(SERIE, USUARIO, ID_TEMPORAL, FECHA_INGRESO, ID_TIPO, TAMANO, ESTADO, NOMBRE, RAZA, SEXO, COLOR, EDAD, ESTERILIZADO,FECHA_ESTERILIZACION)" +
                            "VALUES (@SERIE, @USUARIO, @ID_TEMPORAL, @FECHA_INGRESO, @ID_TIPO, @TAMANO, @ESTADO, @NOMBRE, @RAZA, @SEXO, @COLOR, @EDAD, @ESTERILIZADO, @FECHA_ESTERILIZACION)";

            cone = new MySqlConnection(cadena);
            MySqlCommand com = new MySqlCommand(sql, cone);

            cone.Open();
            Console.Write("entro ");
            com.Parameters.AddWithValue("@SERIE", masc.Serie);
            if (masc.Ser_usu == null)
            {
                com.Parameters.AddWithValue("@USUARIO", null);
            }
            else
            {
                com.Parameters.AddWithValue("@USUARIO", masc.Ser_usu.Serie);
            }
            if (masc.Fic_tem == null)
            {
                com.Parameters.AddWithValue("@ID_TEMPORAL", null);
            }
            else
            {
                com.Parameters.AddWithValue("@ID_TEMPORAL", masc.Fic_tem.Id);
            }
            int    day     = masc.Fecha_ingreso.Day;
            int    mes     = masc.Fecha_ingreso.Month;
            int    annio   = masc.Fecha_ingreso.Year;
            String f_ingre = "" + annio + "-" + mes + "-" + day;

            com.Parameters.AddWithValue("@FECHA_INGRESO", f_ingre);

            if (masc.Tipomascota == null)
            {
                com.Parameters.AddWithValue("@ID_TIPO", null);
            }
            else
            {
                com.Parameters.AddWithValue("@ID_TIPO", masc.Tipomascota.Id);
            }
            com.Parameters.AddWithValue("@TAMANO", masc.Tamano);
            com.Parameters.AddWithValue("@ESTADO", masc.Estado);
            if (!String.IsNullOrEmpty(masc.Nombre))
            {
                com.Parameters.AddWithValue("@NOMBRE", masc.Nombre);
            }
            else
            {
                com.Parameters.AddWithValue("@NOMBRE", null);
            }
            if (!String.IsNullOrEmpty(masc.Raza))
            {
                com.Parameters.AddWithValue("@RAZA", masc.Raza);
            }
            else
            {
                com.Parameters.AddWithValue("@RAZA", null);
            }
            com.Parameters.AddWithValue("@SEXO", masc.Sexo);
            if (!String.IsNullOrEmpty(masc.Color))
            {
                com.Parameters.AddWithValue("@COLOR", masc.Color);
            }
            else
            {
                com.Parameters.AddWithValue("@COLOR", null);
            }
            if (!String.IsNullOrEmpty(masc.Edad))
            {
                com.Parameters.AddWithValue("@EDAD", masc.Edad);
            }
            else
            {
                com.Parameters.AddWithValue("@EDAD", null);
            }
            com.Parameters.AddWithValue("@ESTERILIZADO", masc.Esterilizado);

            int    dayf   = masc.Fecha_esterilizacion.Day;
            int    mesf   = masc.Fecha_esterilizacion.Month;
            int    anniof = masc.Fecha_esterilizacion.Year;
            String date   = "" + annio + "-" + mesf + "-" + dayf;

            com.Parameters.AddWithValue("@FECHA_ESTERILIZACION", date);
            int band;

            try
            {
                band = com.ExecuteNonQuery();
            }
            catch (Exception)
            {
                band = 0;
            }
            cone.Close();
            return(band);
        }
        // GET: Mascota
        public ActionResult DatosMascota(int idMascota)
        {
            Mascota resultado = AD_Mascota.ObtenerMascota(idMascota);

            return(View(resultado));
        }
Exemple #11
0
 public void AgregarMascotaNueva(Mascota mascota)
 {
     mascota.Perdida = false;
     this.context.Mascota.Add(mascota);
     this.context.SaveChanges();
 }
 public void setMascotaSeleccionada(Mascota mascota)
 {
     rootFrame.Navigate(typeof(MascotaPage), mascota);
 }
 public void notificarSeAgregoLaMascota(Mascota mascota)
 {
     misMascotasPage.actualizarColleccionMascota(mascota);
 }
 public Dueño(string n, string c, string nm, string tm, string r)
 {
     this.Nombre  = n;
     this.Cedula  = c;
     this.mascota = new Mascota(nm, tm, r);
 }
Exemple #15
0
        private async Task <bool> CreateMascotasync(Mascota mascota)
        {
            var result = await PostAsync("api/Mascota", mascota);

            return(result.IsSuccessStatusCode);
        }
Exemple #16
0
 /// <summary>
 /// Inicializa el valor de la mascota con la que le pasamos por parámetros.
 /// </summary>
 /// <param name="mascota">Mascota del jugador.</param>
 public void Inicializar(Mascota mascota)
 {
     this.mascota = mascota;
 }
Exemple #17
0
 public Dueño(string nombre, string apellido, int edad, string mTipo,string mRaza, string mNombre, int mEdad)
 {
     this.nombre = nombre;
     this.apellido = apellido;
     this.edad = edad;
     mascota = new Mascota(mTipo,mRaza,mNombre,mEdad);
 }
Exemple #18
0
 public void agregarMascota(Mascota mas)
 {
     repo.agregarMascota(mas);
 }
 public Mascota GuardarNuevaMascota(Mascota mascota)
 {
     return(_mascotaRepository.GuardarNuevaMascota(mascota));
 }
Exemple #20
0
 public void actualizarMascota(Mascota mas)
 {
     repo.actualizarMascota(mas);
 }
Exemple #21
0
        //BOTON AÑADIR NUEVA MASCOTA CLIENTE
        private void BotonAñadirMascotaNuevacliente_Click(object sender, EventArgs e)
        {
            if (CajaIdCliente.Text == "" || CajaNombreMascota.Text == "" || CajaCategoriaMascota.Text == "")
            {
                MessageBox.Show("Rellene las casillas.");
            }
            else
            {
                ConsultasSecretaria conse = new ConsultasSecretaria();
                if (conse.VerificarClienteMascotaSoloId(Convert.ToInt32(CajaIdCliente.Text)))
                {
                    //Existe el cliente, solo basta crear la mascota con la id.
                    Mascota masc = new Mascota();
                    masc.SetIdCliente(Convert.ToInt32(CajaIdCliente.Text));
                    masc.SetNombreMascota(CajaNombreMascota.Text);
                    switch (CajaCategoriaMascota.Text)
                    {
                    case "ESCIÚRIDOS":
                        masc.SetIdCategoriaMascota(1);
                        break;

                    case "MÚRIDOS":
                        masc.SetIdCategoriaMascota(2);
                        break;

                    case "CRICÉTIDOS":
                        masc.SetIdCategoriaMascota(3);
                        break;

                    case "FÉLIDOS":
                        masc.SetIdCategoriaMascota(4);
                        break;

                    case "CÁNIDOS":
                        masc.SetIdCategoriaMascota(5);
                        break;

                    case "MUSTÉLIDOS":
                        masc.SetIdCategoriaMascota(6);
                        break;

                    case "GALLINÁCEAS":
                        masc.SetIdCategoriaMascota(7);
                        break;

                    case "TESTUDÍNIDOS":
                        masc.SetIdCategoriaMascota(8);
                        break;

                    case "TITÓNIDOS":
                        masc.SetIdCategoriaMascota(9);
                        break;
                    }
                    if (conse.RegistrarMascotaSecretaria(masc))
                    {
                        MessageBox.Show("Se ha registrado con exito el cliente y su mascota.");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Ha ocurrido un error. Intente nuevamente.");
                    }
                }
                else
                {
                    MessageBox.Show("El cliente no existe. Intente nuevamente.");
                }
                CajaIdCliente.Text = "";
                CajaCategoriaMascota.ResetText();
                CajaNombreMascota.Text = "";
            }
        }
        static void Main(string[] args)
        {
            int    opcion;
            string respuesta = " ";

            Tienda      tienda      = new Tienda();
            Mascota     mascota     = new Mascota();
            Neumaticos  neumaticos  = new Neumaticos();
            ClassTienda classTienda = new ClassTienda();
            Estudiante  estudiante  = new Estudiante();
            Poligono    poligono    = new Poligono();
            Factorial   factorial   = new Factorial();

            Console.WriteLine("                                        MENU TAREA 3");
            Console.WriteLine("Capitulo 9");
            Console.WriteLine("1. Crear una estructura para los productos de una tienda.");
            Console.WriteLine("2. Crear estructuras enlazadas para la información de una mascota y su dueño.");
            Console.WriteLine("3. Crear una enumeración para los diferentes tipos de neumáticos.");

            Console.WriteLine("Capitulo 10");
            Console.WriteLine("4. Crear el diseño de una clase para llevar el inventario de una tienda.");
            Console.WriteLine("5. Crear una clase para llevar la información de los estudiantes de una escuela");
            Console.WriteLine("6. Crear una clase para polígonos con sobrecarga del constructor.Todos");

            Console.WriteLine("Capitulo 12");
            Console.WriteLine("7. Usar la depuración paso a paso para observar cómo cambia el valor de la variable en el programa del factorial.");

            do
            {
                Console.WriteLine("Elija la opcion del Menu Principal");
                opcion = Convert.ToInt32(Console.ReadLine());
                switch (opcion)
                {
                case 1:
                    Console.WriteLine("Capitulo 9, ejercicio 1");
                    Tiendas[] amigos = new Tiendas[5];
                    amigos[1].articulo = "Blusa";
                    amigos[1].cantidad = "5";
                    amigos[1].precio   = 200;
                    Console.WriteLine(amigos[1].ToString());

                    break;

                case 2:
                    Console.WriteLine("Capitulo 9, ejercicio 3");
                    Mascotas[] ami = new Mascotas[5];
                    ami[1].nombreDueño   = "Maria";
                    ami[1].nombreMascota = "Brenda";
                    ami[1].raza          = "Chiguagua";
                    Console.WriteLine(ami[1].ToString());
                    break;

                case 3:
                    Console.WriteLine("Capitulo 9, ejercicio 4");
                    mascota.ToString();
                    break;

                case 4:
                    Console.WriteLine("Capitulo 10, ejercicio 1");
                    Console.WriteLine("No se va a presentar nada porque no hay que impeimirlos ");
                    break;

                case 5:
                    Console.WriteLine("Capitulo 10, ejercicio 2");
                    Console.WriteLine("No se va a presentar nada porque no hay que impeimirlos ");

                    break;

                case 6:
                    Console.WriteLine("Capitulo 10, ejercicio 3,4,5");
                    poligono.ToString();

                    break;

                case 7:
                    Console.WriteLine("Capitulo 12, ejercicio 1");
                    factorial.calcularfactorial();
                    break;

                default:
                    Console.WriteLine("Opcion no valida");
                    break;
                }
                Console.WriteLine(" ");
                Console.WriteLine("Deseas volver al Menu Principal (si / no) ?");
                respuesta = Console.ReadLine();
            } while (respuesta == "si");
        }
Exemple #23
0
        public int D_modificar_mascota_SinFecha_Esterilizado(Mascota masc)
        {
            String cadena = DConexion.cadena;
            String sql    = "UPDATE mascota  SET  USUARIO=@USUARIO, ID_TEMPORAL=@ID_TEMPORAL, FECHA_INGRESO=@FECHA_INGRESO, ID_TIPO=@ID_TIPO, TAMANO=@TAMANO, ESTADO=@ESTADO, NOMBRE=@NOMBRE, RAZA=@RAZA, SEXO=@SEXO, COLOR=@COLOR, EDAD=@EDAD, ESTERILIZADO=@ESTERILIZADO,FECHA_ESTERILIZACION=@FECHA_ESTERILIZACION WHERE SERIE=@SERIE";

            cone = new MySqlConnection(cadena);
            MySqlCommand com = new MySqlCommand(sql, cone);

            cone.Open();


            if (masc.Ser_usu == null)
            {
                com.Parameters.AddWithValue("@USUARIO", null);
            }
            else
            {
                com.Parameters.AddWithValue("@USUARIO", masc.Ser_usu.Serie);
            }
            if (masc.Fic_tem == null)
            {
                com.Parameters.AddWithValue("@ID_TEMPORAL", null);
            }
            else
            {
                com.Parameters.AddWithValue("@ID_TEMPORAL", masc.Fic_tem.Id);
            }
            int    day     = masc.Fecha_ingreso.Day;
            int    mes     = masc.Fecha_ingreso.Month;
            int    annio   = masc.Fecha_ingreso.Year;
            String f_ingre = "" + annio + "-" + mes + "-" + day;

            com.Parameters.AddWithValue("@FECHA_INGRESO", f_ingre);

            if (masc.Tipomascota == null)
            {
                com.Parameters.AddWithValue("@ID_TIPO", null);
            }
            else
            {
                com.Parameters.AddWithValue("@ID_TIPO", masc.Tipomascota.Id);
            }
            com.Parameters.AddWithValue("@TAMANO", masc.Tamano);
            com.Parameters.AddWithValue("@ESTADO", masc.Estado);
            if (!String.IsNullOrEmpty(masc.Nombre))
            {
                com.Parameters.AddWithValue("@NOMBRE", masc.Nombre);
            }
            else
            {
                com.Parameters.AddWithValue("@NOMBRE", null);
            }
            if (!String.IsNullOrEmpty(masc.Raza))
            {
                com.Parameters.AddWithValue("@RAZA", masc.Raza);
            }
            else
            {
                com.Parameters.AddWithValue("@RAZA", null);
            }
            com.Parameters.AddWithValue("@SEXO", masc.Sexo);
            if (!String.IsNullOrEmpty(masc.Color))
            {
                com.Parameters.AddWithValue("@COLOR", masc.Color);
            }
            else
            {
                com.Parameters.AddWithValue("@COLOR", null);
            }
            if (!String.IsNullOrEmpty(masc.Edad))
            {
                com.Parameters.AddWithValue("@EDAD", masc.Edad);
            }
            else
            {
                com.Parameters.AddWithValue("@EDAD", null);
            }
            com.Parameters.AddWithValue("@ESTERILIZADO", masc.Esterilizado);
            com.Parameters.AddWithValue("@FECHA_ESTERILIZACION", null);

            com.Parameters.AddWithValue("@SERIE", masc.Serie);

            int band;

            try
            {
                band = com.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                band = 0;
                Console.Write("el error es : " + ex.Message);
            }
            cone.Close();
            return(band);
        }
Exemple #24
0
 public void actualizarMascota(Mascota masc)
 {
     getSessionFactory().SaveOrUpdate(masc);
     //getSessionFactory().Flush();
 }
Exemple #25
0
 public Dueño(string sNombreDueño, int sEdadDueño, string NombreMascota, int EdadMascota, string RazaMascota)
 {
     NombreDueño = sNombreDueño;
     EdadDueño   = sEdadDueño;
     Perro       = new Mascota(NombreMascota, EdadMascota, RazaMascota);
 }
        public Mascota Save([FromBody] Mascota mascota)
        {
            var result = _mascotasService.Save(mascota);

            return(result);
        }
Exemple #27
0
 public void agregarMascota(Mascota masc)
 {
     getSessionFactory().SaveOrUpdate(masc);
     getSessionFactory().Flush();
 }
Exemple #28
0
 //Constructor
 public frmMascota()
 {
     InitializeComponent();
     this.unaMascota = null;
 }
Exemple #29
0
 public frmMascota(Mascota mascota) : this()
 {
     this.unaMascota = new Mascota(mascota.Nombre, mascota.TipoDeMascota, mascota.Edad);
 }
Exemple #30
0
 public override void btnAceptar_Click(object sender, EventArgs e)
 {
     this.unaMascota = new Mascota(txtNombre.Text, (eTipoDeMascota)cmbMascota.SelectedIndex, int.Parse(txtEdad.Text));
     base.btnAceptar_Click(sender, e);
 }
Exemple #31
0
        public static bool Serializar(Mascota m)
        {
            m.Serealizador();

            return(true);
        }
        public ActionResult detalleMascota(string id)
        {
            Mascota objU = ListMascota().Where(p => p.ID_MASC == id).FirstOrDefault();

            return(View(objU));
        }
Exemple #33
0
 public void Remove(Mascota mascota)
 {
     context.Remove(mascota);
 }
 public Mascota EditarMascota(Mascota mascota)
 {
     return(_mascotaRepository.EditarMascota(mascota));
 }
Exemple #35
0
 public void ToStringTest()
 {
     Persona persona = new Persona();
     persona.Nombre = "Juan";
     persona.Apellido = "Perez";
     Mascota mascota = new Mascota();
     Assert.AreEqual("Capitulo9WellFormedTypes.Mascota",mascota.ToString());//fully qualifyed name. en el caso de las clases, te regresa este dato, si no se hace override a tostring.
     Assert.AreEqual("1", 1.ToString());//aqui se usa el tostring que viene de object y que se hereda por default.
     Assert.AreEqual("Juan Perez", persona.ToString());//utilizando override en un metodo de persona class, te regresa una representacion en texto.
 }
 public Persona(string n, string a, string d, string nom, string raz)
 {
     this.nombre = n;
     this.apellido = a;
     this.direccion = d;
     mascota = new Mascota(nom, raz);
 }