Ejemplo n.º 1
0
        //
        // Method defiened for search of transactions by Email ID. This method acceptds the search string
        private void SearchByEmailId(string EmailId)
        {
            string ReadTranNum;
            string ReadEmailId;
            string Dump;
            //string Details;
            StreamReader InputFile;

            InputFile = File.OpenText(FILENAME);
            bool IsAvailable = false;

            while (!InputFile.EndOfStream)
            {
                ReadTranNum = InputFile.ReadLine();
                ReadEmailId = InputFile.ReadLine();
                if (ReadEmailId == EmailId)
                {
                    IsAvailable = true;
                    SearchTransactionsListBox1.Items.Add(ReadTranNum);
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                }
                else
                {
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                    Dump = InputFile.ReadLine();
                }
            }
            //
            // Message to show when the search couldn't find the search string user was looking for
            if (IsAvailable == false)
            {
                MessageBox.Show("Couldn't find the transaction number for Email ID you entered", "Search Missing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //
                // Bringing the focus back to Search string text box textbox which is blank and needs user input
                SearchTextBox1.Focus();
            }
        }
Ejemplo n.º 2
0
        //
        // Method defiened for search of transactions by transaction number. This method acceptds the search string
        private void SearchByTransactionNumber(string TransNum)
        {
            string       ReadText;
            string       Details;
            StreamReader InputFile;

            InputFile = File.OpenText(FILENAME);
            int  count       = 1;
            bool IsAvailable = false;

            while (!InputFile.EndOfStream)
            {
                ReadText = InputFile.ReadLine();
                if ((count - 1) % 7 == 0 && ReadText == TransNum)
                {
                    IsAvailable = true;
                    Details     = InputFile.ReadLine();
                    SearchResultEmailIdAnsLabel1.Text = Details;
                    Details = InputFile.ReadLine();
                    SearchResultInvestedAmountAnswerLabel1.Text = Details;
                    Details = InputFile.ReadLine();
                    SearchResultBalanceAmountAnswerLabel1.Text = Details;
                    Details = InputFile.ReadLine();
                    SearchResultTermPlanAnswerLabel1.Text = Details + " Years";
                    Details = InputFile.ReadLine();
                    SearchResultClientNameAnswerLabel1.Text = Details;
                    Details = InputFile.ReadLine();
                    SearchResultTelephoneAnswerLabel1.Text = Details;
                }
                count++;
            }
            //
            // Message to show when the search couldn't find the search string user was looking for
            if (IsAvailable == false)
            {
                MessageBox.Show("Couldn't find the transaction number you entered", "Search Missing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //
                // Bringing the focus back to Search string text box textbox which is blank and needs user input
                SearchTextBox1.Focus();
            }
        }