Exemple #1
0
        public GemFeatureForm( IGemServis servis, ListBox listBoxGem, ComboBox comboBoxColor )
        {
            InitializeComponent ();
            this.listBoxGem = listBoxGem;
            this.comboBoxColor = comboBoxColor;
            this.gem = null;

            this.comboBoxType.Items.AddRange ( new object [] {
                        "Ornamental",
                        "Semiprecious",
                        "Precious"} );
            this.comboBoxType.SelectedIndex = 0;
            this.servis = servis;
        }
Exemple #2
0
        public void Save( Gem gem )
        {
            this.Gem = gem;

            if ( isTableExists () == false )
            {
                createTable ();
            }

            if ( isGemExists () == false )
            {
                saveGem ();
            }
        }
Exemple #3
0
        public GemFeatureForm( IGemServis servis, ListBox listBoxGem, ComboBox comboBoxColor, Gem gem )
        {
            InitializeComponent ();

            this.servis = servis;
            this.listBoxGem = listBoxGem;
            this.comboBoxColor = comboBoxColor;
            this.gem = gem;

            this.Text = "Gem collection";
            this.textBoxName.Text = gem.Name;
            this.textBoxColor.Text = gem.Color.Name;
            this.checkBoxTransparency.Checked = gem.Transparency;

            this.comboBoxType.Items.AddRange
                (
                    new object [] { "Ornamental", "Semiprecious", "Precious", "Unknown"}
                );
            this.comboBoxType.SelectedIndex = getSelectedIndex ( gem.Type.ToString () );

            this.textBoxDescription.Text = gem.Description;
        }