public EditAssetPageControl(FormMain form, int?userAssetID)
        {
            _userAssetID = userAssetID;
            DataBaseAccess dataBase = new DataBaseAccess();

            dataBase.StartConnection();
            _curUserAsset = dataBase.getAsset((int)userAssetID);
            dataBase.CloseConnection();
            InitializeComponent();
            pictureGallery1.InitializePictureGallery((int)_curUserAsset.GetAuthor().GetUserID(), (int)_userAssetID);

            formMain = form;
            if (formMain.UsersAccounts.GetCurrentUser() != null)
            {
                if (_curUserAsset == null || userAssetID == null)
                {
                    MessageBox.Show("Error: Asset Not Found");
                }
                else
                {
                    txtTitle.Text = _curUserAsset.GetAssetTitle();
                    cboAssetType.SelectedIndex   = (int)_curUserAsset.GetAssetType();
                    txtSoftwareUsed.Text         = _curUserAsset.GetSoftwareUsed();
                    cboPegi.SelectedIndex        = (int)_curUserAsset.GetPegiRating();
                    cboAssetStatus.SelectedIndex = (int)_curUserAsset.GetAssetStatus() - 1;
                    txtNotes.Text = _curUserAsset.GetNotes();
                    pictureGallery1.AddPicturesToGallery(_curUserAsset.GetPicturesPath());
                    picThumbnail.ImageLocation = _curUserAsset.GetThumbNail();

                    _userAsset.SetAssetTitle(_curUserAsset.GetAssetTitle());
                    _userAsset.SetAssetStatus(_curUserAsset.GetAssetStatus());
                    _userAsset.SetAssetType(_curUserAsset.GetAssetType());
                    _userAsset.SetSoftwareUsed(_curUserAsset.GetSoftwareUsed());
                    _userAsset.SetPegiRating(_curUserAsset.GetPegiRating());
                    _userAsset.SetNotes(_curUserAsset.GetNotes());
                }
            }
            else
            {
                MessageBox.Show("Error: No user logged in");
            }
        }
 private void TextInput(object sender, EventArgs e)
 {
     if (((TextBox)sender) == txtTitle)
     {
         _userAsset.SetAssetTitle(txtTitle.Text);
     }
     else if (((TextBox)sender) == txtSoftwareUsed)
     {
         _userAsset.SetSoftwareUsed(txtSoftwareUsed.Text);
     }
     else if (((TextBox)sender) == txtNotes)
     {
         _userAsset.SetNotes(txtNotes.Text);
     }
     txt_Leave(sender, e);
 }