コード例 #1
0
        public string[] Actualizar(int Id, string Nombre, string Descripcion, string etapa_vida,
                                   string sexo, string especie, DateTime fecha_nac, string raza, int disponible, DateTime fecha_registro)
        {
            // Codigo a implementar
            MascotaE mascotaE = new MascotaE();

            mascotaE.id             = Id;
            mascotaE.nombre         = Nombre;
            mascotaE.descripcion    = Descripcion;
            mascotaE.etapa_vida     = etapa_vida;
            mascotaE.sexo           = sexo;
            mascotaE.especie        = especie;
            mascotaE.fecha_nac      = fecha_nac;
            mascotaE.raza           = raza;
            mascotaE.disponible     = disponible;
            mascotaE.fecha_registro = fecha_registro;
            Mascota mascota  = new Mascota();
            bool    codError = mascota.Actualizar(mascotaE);
            string  mensaje  = mascota.Mensaje;

            string[] respuesta = { codError.ToString(), mensaje };
            return(respuesta);
        }
コード例 #2
0
ファイル: Mascota.cs プロジェクト: mer24573/SlnRefugio
 public bool Agregar(MascotaE mascota)
 {
     try
     {
         DataRow fila = datos.TraerDataRow("spAgregarMascota", mascota.id, mascota.nombre, mascota.descripcion, mascota.etapa_vida,
                                           mascota.sexo, mascota.especie, mascota.fecha_nac, mascota.raza, mascota.disponible, mascota.fecha_registro);
         mensaje = fila["Mensaje"].ToString();
         byte codError = Convert.ToByte(fila["CodError"]);
         if (codError == 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         mensaje = "Error: " + ex.Message;
         return(false);
     }
 }