Example #1
0
 private void docSharingPanelShareBtn_Click(object sender, EventArgs e)
 {
     sharingServiceClient = new SharingServiceClient();
     sharingServiceClient.shareDocument(documentData, sharedBy, sharedToTextBox.Text);
     documentSharingPanel.Visible = false;
     MessageBox.Show("Document shared to " + sharedToTextBox.Text);
 }
Example #2
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
                    });
                }
            }
        }
Example #3
0
        private void guna2Button5_Click(object sender, EventArgs e)
        {
            //documentPanel.Show();
            documentPanel.Visible = true;
            //diaryPanel.Show();
            diaryPanel.Visible = true;
            //sharedPanel.Show();
            sharedPanel.Visible = true;

            accountPanel.Visible = false;
            //sharedDocumentSharingUC.Hide();
            //sharedDocumentSharingUC2.Visible = false;
            sharedDocumentSharingPanel.Visible = false;
            //sharedDocumentViewer.Hide();
            sharedDocumentViewer.Visible = false;


            //refreshSharedDocumentBtn.Show();
            refreshSharedDocumentBtn.Visible = true;
            //sharedDocumentDataGridView.Show();
            sharedDocumentDataGridView.Visible = true;



            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
                });
            }
        }
Example #4
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(searchTextBox.Text))
            {
                MessageBox.Show("Enter search text.");
                return;
            }
            if (searchComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Please select type for search text");
                return;
            }
            if (searchComboBox.Items[searchComboBox.SelectedIndex].ToString() == "Diaries")
            {
                //MessageBox.Show("Search type : "+ searchComboBox.Items[searchComboBox.SelectedIndex].ToString()+"\nSearch text : "+ searchTextBox.Text);
                guna2Button4.PerformClick();

                diaryDataGridView.Visible = true;
                personalDiaryClient       = new DiaryService.PersonalDiaryClient();
                diaries = personalDiaryClient.getAllDiaryData(UserConfiguration.strUserEmail);
                bool[] isMatched = new bool[diaries.Length];

                diaryDataGridView.Rows.Clear();
                for (int i = 0; i < diaries.Length; i++)
                {
                    if (diaries[i].title.ToLower().Contains(searchTextBox.Text.ToLower()))
                    {
                        isMatched[i] = true;
                    }
                    else
                    {
                        isMatched[i] = false;
                    }
                }
                for (int i = 0; i < diaries.Length; i++)
                {
                    if (isMatched[i])
                    {
                        diaryDataBindingSource.Add(new DiaryData()
                        {
                            date = diaries[i].date, title = diaries[i].title
                        });
                    }
                }
            }
            if (searchComboBox.Items[searchComboBox.SelectedIndex].ToString() == "Documents")
            {
                //MessageBox.Show("Search type : " + searchComboBox.Items[searchComboBox.SelectedIndex].ToString() + "\nSearch text : " + searchTextBox.Text);
                guna2Button1.PerformClick();

                documentDataGridView.Visible = true;

                documentServiceClient = new DocumentService.DocumentServiceClient();
                documents             = documentServiceClient.getAllDocumnetData(UserConfiguration.strUserEmail);
                bool[] isMatched = new bool[documents.Length];

                documentDataGridView.Rows.Clear();
                for (int i = 0; i < documents.Length; i++)
                {
                    if (documents[i].fileName.ToLower().Contains(searchTextBox.Text.ToLower()))
                    {
                        isMatched[i] = true;
                    }
                    else
                    {
                        isMatched[i] = false;
                    }
                }
                for (int i = 0; i < documents.Length; i++)
                {
                    if (isMatched[i])
                    {
                        documentDataBindingSource.Add(new DocumentService.DocumentData()
                        {
                            fileName = documents[i].fileName
                        });
                    }
                }
            }
            if (searchComboBox.Items[searchComboBox.SelectedIndex].ToString() == "Accounts")
            {
                //MessageBox.Show("Search type : " + searchComboBox.Items[searchComboBox.SelectedIndex].ToString() + "\nSearch text : " + searchTextBox.Text);

                AccountsBtn.PerformClick();
                accountServiceClient = new AccountService.AccountServiceClient();
                userAccountData      = accountServiceClient.getAllAccounts(UserConfiguration.strUserEmail);
                bool[] isMatched = new bool[userAccountData.Length];


                accountDataGirdView.Rows.Clear();


                for (int i = 0; i < userAccountData.Length; i++)
                {
                    if (userAccountData[i].UserAccountName.ToLower().Contains(searchTextBox.Text.ToLower()))
                    {
                        isMatched[i] = true;
                    }
                    else
                    {
                        isMatched[i] = false;
                    }
                }
                for (int i = 0; i < userAccountData.Length; i++)
                {
                    if (isMatched[i])
                    {
                        userAccountDataBindingSource.Add(new AccountService.UserAccountData()
                        {
                            UserAccountName = userAccountData[i].UserAccountName
                        });
                    }
                }
            }
            if (searchComboBox.Items[searchComboBox.SelectedIndex].ToString() == "Shared Documents")
            {
                //MessageBox.Show("Search type : " + searchComboBox.Items[searchComboBox.SelectedIndex].ToString() + "\nSearch text : " + searchTextBox.Text);
                guna2Button5.PerformClick();


                sharingServiceClient = new SharingService.SharingServiceClient();
                sharedDocments       = sharingServiceClient.getSharedDocument(UserConfiguration.strUserEmail);
                bool[] isMatched = new bool[sharedDocments.Length];

                sharedDocumentDataGridView.Rows.Clear();
                for (int i = 0; i < sharedDocments.Length; i++)
                {
                    if (sharedDocments[i].fileName.ToLower().Contains(searchTextBox.Text.ToLower()))
                    {
                        isMatched[i] = true;
                    }
                    else
                    {
                        isMatched[i] = false;
                    }
                }
                for (int i = 0; i < sharedDocments.Length; i++)
                {
                    if (isMatched[i])
                    {
                        sharedDocumentDataBindingSource.Add(new SharedDocumentData()
                        {
                            fileName = sharedDocments[i].fileName, sharedBy = sharedDocments[i].sharedBy
                        });
                    }
                }
            }
        }