示例#1
0
 public int bajaImagen(Imagenes img)
 {
     Command.CommandText = "delete from imagenes where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona", img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     return Command.ExecuteNonQuery();
 }
示例#2
0
 public int bajaImagen(Imagenes img)
 {
     Command.CommandText = "delete from imagenes where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona", img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     return(Command.ExecuteNonQuery());
 }
示例#3
0
 public int actualizaImagen(Imagenes img)
 {
     Command.CommandText = "update imagenes set imagen = @imagen where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona", img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     return(Command.ExecuteNonQuery());
 }
示例#4
0
 public int insertaImagen(Imagenes img)
 {
     Command.CommandText = "insert into imagenes (idpersona, imagen, tipopersona) values (@idpersona,@imagen,@tipopersona)";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona",img.idpersona);
     Command.Parameters.AddWithValue("imagen", img.imagen);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     return Command.ExecuteNonQuery();
 }
示例#5
0
 public object ExisteImagen(Imagenes img)
 {
     Command.CommandText = "select count(*) from imagenes where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona",img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     object existe = Select(Command);
     return existe;
 }
示例#6
0
 public int actualizaImagen(Imagenes img)
 {
     Command.CommandText = "update imagenes set imagen = @imagen where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona", img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     Command.Parameters.AddWithValue("imagen",img.imagen);
     return Command.ExecuteNonQuery();
 }
示例#7
0
 public int insertaImagen(Imagenes img)
 {
     Command.CommandText = "insert into imagenes (idpersona, imagen, tipopersona) values (@idpersona,@imagen,@tipopersona)";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona", img.idpersona);
     Command.Parameters.AddWithValue("imagen", img.imagen);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     return(Command.ExecuteNonQuery());
 }
示例#8
0
 public List<Imagenes> obtenerImagen(Imagenes img)
 {
     DataTable dtImagen = new DataTable();
     List<Imagenes> lstImagen = new List<Imagenes>();
     Command.CommandText = "select * from imagenes where idpersona = @idpersona and tipopersona = @tipopersona";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idpersona",img.idpersona);
     Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
     dtImagen = SelectData(Command);
     for (int i = 0; i < dtImagen.Rows.Count; i++)
     {
         Imagenes imagen = new Imagenes();
         imagen.idimagen = int.Parse(dtImagen.Rows[i]["idimagen"].ToString());
         imagen.idpersona = int.Parse(dtImagen.Rows[i]["idpersona"].ToString());
         imagen.imagen = (byte[])dtImagen.Rows[i]["imagen"];
         imagen.tipopersona = int.Parse(dtImagen.Rows[i]["tipopersona"].ToString());
         lstImagen.Add(imagen);
     }
     return lstImagen;
 }
示例#9
0
        public List <Imagenes> obtenerImagen(Imagenes img)
        {
            DataTable       dtImagen  = new DataTable();
            List <Imagenes> lstImagen = new List <Imagenes>();

            Command.CommandText = "select * from imagenes where idpersona = @idpersona and tipopersona = @tipopersona";
            Command.Parameters.Clear();
            Command.Parameters.AddWithValue("idpersona", img.idpersona);
            Command.Parameters.AddWithValue("tipopersona", img.tipopersona);
            dtImagen = SelectData(Command);
            for (int i = 0; i < dtImagen.Rows.Count; i++)
            {
                Imagenes imagen = new Imagenes();
                imagen.idimagen    = int.Parse(dtImagen.Rows[i]["idimagen"].ToString());
                imagen.idpersona   = int.Parse(dtImagen.Rows[i]["idpersona"].ToString());
                imagen.imagen      = (byte[])dtImagen.Rows[i]["imagen"];
                imagen.tipopersona = int.Parse(dtImagen.Rows[i]["tipopersona"].ToString());
                lstImagen.Add(imagen);
            }
            return(lstImagen);
        }