コード例 #1
0
        List <Materials> GetMaterialsCorteges(SqlConnection conn)
        {
            SqlCommand sqlCommand = new SqlCommand("Select * from vwMaterialsAndPriceForGramm", conn);

            using (sqlDataReader = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection))
            {
                if (sqlDataReader.HasRows)
                {
                    while (sqlDataReader.Read())
                    {
                        material               = new Materials();
                        material.Name          = sqlDataReader.GetValue(0).ToString().Trim();
                        material.PriceForGramm = Convert.ToSingle(sqlDataReader.GetValue(1));
                        materials.Add(material);
                    }
                }
            }
            return(materials);
        }
コード例 #2
0
 protected void CreateMaterial()
 {
     material = new Materials();
 }