Ejemplo n.º 1
0
        private void sharedDocumentDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (sharedDocumentDataGridView.Columns[e.ColumnIndex].Name == "viewSharedPdf")
            {
                currentlyOpenedSharedFile = sharedDocments[e.RowIndex].fileName;
                sharedDocumentViewer.src  = sharedDocments[e.RowIndex].fileLink;
                //sharedDocumentViewer.Show();
                sharedDocumentViewer.Visible = true;


                MessageBox.Show(sharedDocments[e.RowIndex].fileName + " opening...");
            }

            if (sharedDocumentDataGridView.Columns[e.ColumnIndex].Name == "shareSharedPdf")
            {
                sharedBy              = UserConfiguration.strUserEmail;
                documentData          = new SharingService.DocumentData();
                documentData.fileName = sharedDocments[e.RowIndex].fileName;
                documentData.fileLink = sharedDocments[e.RowIndex].fileLink;


                //sharedDocumentSharingUC2.Visible = true;
                sharedDocumentSharingPanel.Visible = true;
                sharedDocSharingTextBox.Text       = "";
            }

            if (sharedDocumentDataGridView.Columns[e.ColumnIndex].Name == "deleteSharedPdf")
            {
                sharedTo                    = UserConfiguration.strUserEmail;
                sharedDocumentData          = new SharedDocumentData();
                sharedDocumentData.fileName = sharedDocments[e.RowIndex].fileName;
                sharedDocumentData.fileLink = sharedDocments[e.RowIndex].fileLink;
                sharedDocumentData.sharedBy = sharedDocments[e.RowIndex].sharedBy;

                sharingServiceClient = new SharingServiceClient();
                sharingServiceClient.deleteSharedDocument(sharedDocumentData, sharedTo);


                MessageBox.Show(sharedDocments[e.RowIndex].fileName + " deleted.");

                if (currentlyOpenedSharedFile == sharedDocments[e.RowIndex].fileName)
                {
                    sharedDocumentViewer.Visible = false;
                }

                sharingServiceClient = new SharingService.SharingServiceClient();
                sharedDocments       = sharingServiceClient.getSharedDocument(UserConfiguration.strUserEmail);


                sharedDocumentDataGridView.Rows.Clear();
                for (int i = 0; i < sharedDocments.Length; i++)
                {
                    sharedDocumentDataBindingSource.Add(new SharedDocumentData()
                    {
                        fileName = sharedDocments[i].fileName, sharedBy = sharedDocments[i].sharedBy
                    });
                }
            }
        }
Ejemplo n.º 2
0
        private void documentDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (documentDataGridView.Columns[e.ColumnIndex].Name == "viewPdf")
            {
                currentlyOpenedFile = documents[e.RowIndex].fileName;
                axAcroPDF1.src      = documents[e.RowIndex].fileLink;
                //axAcroPDF1.Show();
                axAcroPDF1.Visible = true;
                //addDocument1.Hide();
                MessageBox.Show(documents[e.RowIndex].fileName + " opening...");
            }

            if (documentDataGridView.Columns[e.ColumnIndex].Name == "sharePdf")
            {
                //addDocument1.Hide();
                sharedBy              = UserConfiguration.strUserEmail;
                documentData          = new SharingService.DocumentData();
                documentData.fileName = documents[e.RowIndex].fileName;
                documentData.fileLink = documents[e.RowIndex].fileLink;

                documentSharingPanel.Visible = true;
                sharedToTextBox.Text         = "";
                //documentSharingUC1.Visible = true;
            }

            if (documentDataGridView.Columns[e.ColumnIndex].Name == "deletePdf")
            {
                //addDocument1.Hide();
                documentServiceClient = new DocumentService.DocumentServiceClient();

                documentServiceClient.deleteDocument(UserConfiguration.strUserEmail, documents[e.RowIndex].fileName);

                MessageBox.Show(documents[e.RowIndex].fileName + " deleted.");

                if (currentlyOpenedFile == documents[e.RowIndex].fileName)
                {
                    axAcroPDF1.Visible = false;
                }
                documents = documentServiceClient.getAllDocumnetData(UserConfiguration.strUserEmail);

                documentDataGridView.Rows.Clear();
                for (int i = 0; i < documents.Length; i++)
                {
                    documentDataBindingSource.Add(new DocumentService.DocumentData()
                    {
                        fileName = documents[i].fileName
                    });
                }
            }
        }