SmartDeviceProject1.AddEditItem.AddEditItem_Load C# (CSharp) Method

AddEditItem_Load() private method

private AddEditItem_Load ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void AddEditItem_Load(object sender, EventArgs e)
        {
            LoadPriorityAndStatus();

            if (!IsNewItem)
            {
                if (null == Item)
                {
                    MessageBox.Show("Item property cannot be null when editing an Item", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);

                    this.Close();
                    return;
                }

                textBoxName.Text = Item.Name;
                textBoxDescription.Text = Item.Description;

                if (null != Item.Priority)
                {
                    comboBoxPriority.SelectedIndex = Item.Priority.Value - 1;
                }

                if (null != Item.Status)
                {
                    comboBoxStatus.SelectedIndex = Item.Status.Value - 1;
                }
            }
        }