Esempio n. 1
0
        private void addDiarySubmitBtn_Click(object sender, EventArgs e)
        {
            string date    = addDiaryDateTextBox.Text;
            string title   = addDiaryTitleTextBox.Text;
            string content = addDiaryContetTextBox.Text;

            personalDiaryClient = new DiaryService.PersonalDiaryClient();
            personalDiaryClient.UploadDayThought(date, title, content, UserConfiguration.strUserEmail);
            MessageBox.Show("Diary saved.");
            addDiaryPanel1.Visible = false;
        }
Esempio n. 2
0
        private void guna2GradientButton1_Click(object sender, EventArgs e)
        {
            //addDiaryUC1.Visible = false;
            addDiaryPanel1.Visible    = false;
            diaryDataGridView.Visible = true;
            personalDiaryClient       = new DiaryService.PersonalDiaryClient();
            diaries = personalDiaryClient.getAllDiaryData(UserConfiguration.strUserEmail);

            diaryDataGridView.Rows.Clear();
            for (int i = 0; i < diaries.Length; i++)
            {
                diaryDataBindingSource.Add(new DiaryData()
                {
                    date = diaries[i].date, title = diaries[i].title
                });
            }
        }
Esempio n. 3
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
                        });
                    }
                }
            }
        }