private void btnUploadThumbnail_Click(object sender, EventArgs e)
        {
            string _uploadedPic = HelperTools.LoadFromFile("Choose Image", "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg");

            _uploadedPic  = HelperTools.AddFileToStorage(_uploadedPic, (int)_curUserProject.GetAuthor().GetUserID(), _curUserProjectID);
            _thumbNailPic = _uploadedPic;
            picThumbnail.ImageLocation = _thumbNailPic;
        }
Beispiel #2
0
        private void btnChangeProfilePic_Click(object sender, EventArgs e)
        {
            string         file           = HelperTools.LoadFromFile();
            string         databasePath   = HelperTools.AddFileToStorage(file, (int)_currentUser.GetUserID());
            DataBaseAccess dataBaseAccess = new DataBaseAccess();

            dataBaseAccess.StartConnection();
            dataBaseAccess.ChangeUserProfile((int)_currentUser.GetUserID(), databasePath);
            dataBaseAccess.CloseConnection();
        }
        private void btnUploadAsset_Click(object sender, EventArgs e)
        {
            bool errorDetected = false;

            if (txtTitle.Text == string.Empty)
            {
                lblErrorTitle.Show();
                errorDetected = true;
            }
            if (cboAssetType.SelectedIndex < 0)
            {
                lblErrorAssetType.Show();
                errorDetected = true;
            }
            if (txtSoftwareUsed.Text == string.Empty)
            {
                lblErrorSoftwareUsed.Show();
                errorDetected = true;
            }
            if (cboPegi.SelectedIndex < 0)
            {
                lblErrorPegi.Show();
                errorDetected = true;
            }
            if (cboAssetType.SelectedIndex < 0)
            {
                lblErrorAssetStatus.Show();
                errorDetected = true;
            }
            if (_assetUploaded == false)
            {
                lblErrorAssetStatus.Show();
                errorDetected = true;
            }

            if (errorDetected == false)
            {
                DataBaseAccess dataBase = new DataBaseAccess();
                dataBase.StartConnection();
                int assetDatabaseID = dataBase.AddAsset(_userAsset.GetAssetTitle(), (int)formMain.UsersAccounts.GetCurrentUser().GetUserID(), _userAsset.GetAssetStatus(), _userAsset.GetAssetType(), _userAsset.GetSoftwareUsed(), _userAsset.GetNotes(), "", _userAsset.GetPegiRating());
                dataBase.ChangeAssetPath(assetDatabaseID, HelperTools.AddFileToStorage(_assetFilePath, (int)_curUserID, assetDatabaseID));
                dataBase.CloseConnection();

                formMain.curSelectedAssetID = assetDatabaseID;

                formMain.ChangeToPage(FormMain.Pages.EditAssetPage);
            }
        }
        private void btnUpload_Click(object sender, EventArgs e)
        {
            string _uploadedPic = HelperTools.LoadFromFile("Choose Image", "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg");

            _uploadedPic = HelperTools.AddFileToStorage(_uploadedPic, _userID, _assetID);
            if (_uploadedPic != string.Empty)
            {
                if (_pictures[_pictureInView] == "null")
                {
                    _pictures[_pictureInView] = _uploadedPic;
                    picImage.ImageLocation    = _pictures[_pictureInView];
                }
                else
                {
                    _pictures.Add(_uploadedPic);
                    _pictureInView++;
                    picImage.ImageLocation = _pictures[_pictureInView];
                }
            }
            else
            {
                picImage.ImageLocation = _pictures[_pictureInView];
            }
        }