Пример #1
0
        public box Clone()
        {
            box one = new box();

            one.name   = name.Clone().ToString();
            one.length = length;
            one.width  = width;
            one.height = height;
            one.volume = volume;
            return(one);
        }
Пример #2
0
        public List <box> getBoxes()
        {
            List <box>    boxes = new List <box>();
            SQLiteCommand cmd   = new SQLiteCommand(m_con);

            cmd.CommandText = "select * from box";
            SQLiteDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                box one = new box();
                one.name   = dr.GetString(0);
                one.length = dr.GetDouble(1);
                one.width  = dr.GetDouble(2);
                one.height = dr.GetDouble(3);
                one.volume = dr.GetDouble(4);
                boxes.Add(one);
            }
            return(boxes);
        }