Esempio n. 1
0
        /// <summary>
        /// Gets the attributes for a new label.
        /// </summary>
        /// <param name="id">The ID that will be assigned to the new label</param>
        /// <returns>True if attributes entered OK (m_LastRow defined).</returns>
        bool GetAttributes(string id)
        {
            // There HAS to be a schema.
            if (m_Schema == null)
            {
                return(false);
            }

            // Although unlikely, it is conceivable that the attributes have already
            // been loaded into the database. In that case, display the existing
            // attributes for editing.

            AttributeDataForm dial;

            DataRow[] existingData = AttributeData.FindByKey(m_Schema, id);
            if (existingData.Length > 0)
            {
                dial = new AttributeDataForm(m_Schema, existingData[0]);
            }
            else
            {
                dial = new AttributeDataForm(m_Schema, id);
            }

            if (dial.ShowDialog() == DialogResult.OK)
            {
                m_LastRow = dial.Data;
            }
            else
            {
                m_LastRow = null;
            }

            dial.Dispose();
            return(m_LastRow != null);
        }