Ejemplo n.º 1
0
        public List <ThicknessTable> GetThickness()
        {
            List <ThicknessTable> thicknesses = new List <ThicknessTable>();

            try
            {
                connection.Open();
                var command = new OleDbCommand();
                command.Connection  = connection;
                command.CommandText = "select * from Thickness";
                var reader = command.ExecuteReader();

                while (reader.Read())
                {
                    ThicknessTable thickness = new ThicknessTable();
                    thickness.thickness = reader.GetString(1);
                    thickness.type      = reader.GetString(2);
                    thicknesses.Add(thickness);
                }

                thicknesses.Sort();
                reader.Close();
                connection.Close();
                return(thicknesses);
            }
            catch (Exception e) { }
            finally { }

            return(thicknesses);
        }
Ejemplo n.º 2
0
        public int CompareTo(Object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            ThicknessTable other = obj as ThicknessTable;

            if (this.type != other.type)
            {
                return(this.type.CompareTo(other.type));
            }
            else
            {
                float mythick    = float.Parse(this.thickness);
                float otherthick = float.Parse(other.thickness);
                return(mythick.CompareTo(otherthick));
            }
        }