public TipoMaterialDTO BuscarPorId(int id) { try { Conexion.Abrir(); string sql = "SELECT TOP(1) * " + "FROM TipoMaterial " + "WHERE TipoMaterialId = " + id; SqlCommand cmd = new SqlCommand(sql, Conexion.Conn); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { TipoMaterialDTO tm = new TipoMaterialDTO( Convert.ToInt32(reader["TipoMaterialId"].ToString().Trim()), reader["TipoMaterial"].ToString().Trim() ); return(tm); } else { return(null); } } catch (SqlException e) { Console.WriteLine(e.StackTrace); return(null); } finally { if (Conexion.Conn != null) { Conexion.Cerrar(); } } }
internal void SeedMethod() { _tipoMaterialForCreationDto = new TipoMaterialForCreationDto { Nombre = "Cuero Liso", Codigo = "COD001" }; _tipoMaterial = new TipoMaterial { Nombre = "Cuero Liso", Codigo = "COD001", EstaActivo = true }; _tipoMaterialDto = new TipoMaterialDTO { Nombre = "Cuero Liso", Codigo = "COD001" }; }
public List <MaterialDTO> BusquedaAvanzada(string texto, IdiomaDTO i, TipoMaterialDTO tm) { throw new NotImplementedException(); }
public void Ingresar(TipoMaterialDTO obj) { throw new NotImplementedException(); }