Exemple #1
0
        public EventPropertyForm(CollectionEventProperty ceProp)
            : this(true)
        {
            if (ceProp != null)
            {
                this._ceProp   = ceProp;
                Cursor.Current = Cursors.WaitCursor;

                Property prop = null;

                try
                {
                    prop = DataFunctions.Instance.RetrieveProperty((int)_ceProp.PropertyID);
                }
                catch (ConnectionCorruptedException ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    this.Close();
                }

                // fill Form
                if (prop != null)
                {
                    if (prop.DisplayText != null)
                    {
                        this.labelCaption.Text = prop.DisplayText;
                    }
                }

                if (_ceProp.AverageValueCache != null)
                {
                    this.labelAverageValue.Text = _ceProp.AverageValueCache.ToString();
                }

                if (_ceProp.DisplayText != null)
                {
                    this.textBoxDisplayText.Text = _ceProp.DisplayText;
                }

                if (_ceProp.PropertyValue != null)
                {
                    this.textBoxValue.Text = _ceProp.PropertyValue;
                }

                if (_ceProp.ResponsibleName != null)
                {
                    this.labelResponsible.Text = _ceProp.ResponsibleName;
                }

                Cursor.Current = Cursors.Default;
            }
            else
            {
                this.Close();
            }
        }
Exemple #2
0
 public EventPropertyVM(CollectionEventProperty p)
     : base(p)
 {
 }