private void guna2GradientTileButton1_Click(object sender, EventArgs e) { //addDocumentUC.Hide(); //addDocumentUC1.Visible = false; addDocumentPanel.Visible = false; //documentSharingUC.Hide(); documentSharingUC1.Visible = false; //axAcroPDF1.Hide(); axAcroPDF1.Visible = false; //documentDataGridView.Show(); documentDataGridView.Visible = true; documentServiceClient = new DocumentService.DocumentServiceClient(); 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 }); } }
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 }); } } }
public Dashboard() { InitializeComponent(); UserConfiguration.strUserEmail = "*****@*****.**"; //documentPanel.Show(); documentPanel.Visible = true; //diaryPanel.Hide(); diaryPanel.Visible = false; //documentSharingUC.Hide(); //documentSharingUC1.Visible = false; documentSharingPanel.Visible = false; //addDocumentUC.Hide(); //addDocumentUC1.Visible = false; addDocumentPanel.Visible = false; //documentDataGridView.Hide(); //axAcroPDF1.Hide(); axAcroPDF1.Visible = false; documentDataGridView.Visible = true; documentServiceClient = new DocumentService.DocumentServiceClient(); 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 }); } searchComboBox.Items.Add("Diaries"); searchComboBox.Items.Add("Documents"); searchComboBox.Items.Add("Accounts"); searchComboBox.Items.Add("Shared Documents"); accountNameLabel.Text = UserConfiguration.strUserEmail; timer1.Start(); }
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 }); } } } }