Beispiel #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            UserBusinessModel UserModel = new UserBusinessModel();
            bool Response = UserModel.IsAuthenticatedByApi(UserBusinessModel.GetUser(verifiedUserEmailId));

            if (Response)
            {
                LoginCredentials.LoggedEmailId = verifiedUserEmailId;
                List <Form> forms = new List <Form>();

                foreach (Form f in Application.OpenForms)
                {
                    forms.Add(f);
                }

                foreach (Form f in forms)
                {
                    f.Hide();
                }


                timer1.Stop();
                Mailbox _mailbox = new Mailbox();
                _mailbox.Show();
            }
            else
            {
                synth.SpeakAsync("I am still waiting for your response ,Please press your band");
            }
        }
Beispiel #2
0
        private void txtEmail_Leave()
        {
            if (SpeechModule.GetStatus())
            {
                int User_id = UserBusinessModel.GetUser(txtEmail.Text);
                if (txtEmail.Text != "")
                {
                    synth.Speak("You said " + txtEmail.Text + "as the mail Id");
                    //synth.Speak("Please say the subject for this mail");
                    //  SpeechToTextalgorithm();
                }
                else
                {
                    synth.Speak("Email id field is empty");
                }
                //else
                //{


                //    synth.Speak("The mail id you told is not registered with our application");
                //    synth.Speak("Please say the recipient mail id and press the space button");
                //    txtEmail.Clear();
                //    txtEmail.Focus();

                //}
            }
        }
Beispiel #3
0
        private void speechRecognitionWithDictationGrammar_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            bool IsInvaliduser = true;
            bool Isvaliduser   = false;

            // synth.Speak(string.Format("You told {0}", e.Result.Text));
            //MessageBox.Show(e.Result.Text);
            foreach (var Email in listEmails)
            {
                // if(true)
                if (e.Result.Text.Trim().ToLower().Contains(Email.Trim().ToLower()))
                {
                    IsInvaliduser       = false;
                    Isvaliduser         = true;
                    txtUsername.Text    = Email.Trim().ToLower();
                    Msg.Visible         = true;
                    Loader.Visible      = true;
                    verifiedUserEmailId = Email;
                    synth.Speak(string.Format("Hello {0}", Email));
                    synth.Speak("Welcome Back");
                    UserBusinessModel UserModel = new UserBusinessModel();
                    int HitCount = UserModel.GenerateBandHitCode(UserBusinessModel.GetUser(verifiedUserEmailId));
                    synth.Speak(string.Format("Please press your band {0} times to authorize your identity", HitCount));
                    LblInvaliduser.Visible = false;
                    _recognizer.Dispose();
                    break;
                }
            }



            if (IsInvaliduser)
            {
                LblInvaliduser.Visible = true;


                //  synth.Speak(string.Format("Invalid User", e.Result.Text));
                txtUsername.Text = "";
            }
            if (Isvaliduser)
            {
                InitAuthenticator();
            }
        }
Beispiel #4
0
        private void btnDraft_Click(object sender, EventArgs e)
        {
            Mail _mail = new Mail();

            _mail.EmailID     = txtEmail.Text;
            _mail.Subject     = txtSubject.Text;
            _mail.Message     = richTextBox1.Text;
            _mail.FromEmailId = LoginCredentials.LoggedEmailId;
            _mail.FileName    = AttachmentName;
            string IsEmptyUSer = IsEmpty.CheckIfEmpty_Mail(_mail);

            if (IsEmptyUSer != null)
            {
                MessageBox.Show(IsEmptyUSer, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int User_id = UserBusinessModel.GetUser(_mail.EmailID);
                if (User_id != 0)
                {
                    _mail.UserId = User_id;
                    MailServer _composeMail = new MailServer();
                    if (_composeMail.SaveMail(_mail))
                    {
                        MessageBox.Show("Mail saved to draft sucessfully", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }

                    else
                    {
                        MessageBox.Show("Unable save this mail", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("EmailID is not registered with our domain", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            this.Close();
        }
Beispiel #5
0
        private void SentMail()
        {
            MailServer _composeMail = new MailServer();

            if (Mailtype.ComposeMail == MailTypeEnum || Mailtype.ReplyMail == MailTypeEnum || Mailtype.ForwardMail == MailTypeEnum)
            {
                Mail _mail = new Mail();
                _mail.EmailID     = txtEmail.Text;
                _mail.Subject     = txtSubject.Text;
                _mail.Message     = richTextBox1.Text;
                _mail.FromEmailId = LoginCredentials.LoggedEmailId;
                _mail.FileName    = txtAttachment.Text.Trim();
                string IsEmptyUSer = IsEmpty.CheckIfEmpty_Mail(_mail);
                int    User_id     = UserBusinessModel.GetUser(_mail.EmailID);

                if (IsEmptyUSer != null)
                {
                    MessageBox.Show(IsEmptyUSer, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (User_id != 0)
                    {
                        _mail.UserId = User_id;

                        if (_composeMail.SentMail(_mail))
                        {
                            if (SpeechModule.GetStatus() && MailTypeEnum == Mailtype.ComposeMail) //Only for compose mail help text speech work
                            {
                                synth.Speak("The mail sucessfully sent to the recipient");
                                synth.Speak("We are back to our main window");
                                List <Form> forms = new List <Form>();
                                foreach (Form f in Application.OpenForms)
                                {
                                    forms.Add(f);
                                }

                                foreach (Form f in forms)
                                {
                                    f.Hide();
                                }



                                Mailbox _mailbox = new Mailbox();
                                _mailbox.Show();
                            }
                            else
                            {
                                synth.Speak("The mail sucessfully sent to the recipient");
                                synth.Speak("We are back to our main window");
                                List <Form> forms = new List <Form>();
                                foreach (Form f in Application.OpenForms)
                                {
                                    forms.Add(f);
                                }

                                foreach (Form f in forms)
                                {
                                    f.Hide();
                                }



                                Mailbox _mailbox = new Mailbox();
                                _mailbox.Show();
                            }
                        }

                        else
                        {
                            MessageBox.Show("Unable to sent mail", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show("EmailID is not registered with our domain", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            else if (Mailtype.DraftMail == MailTypeEnum)
            {
                if (MailServer.ResentDraftMail(_msg_id))
                {
                    if (SpeechModule.GetStatus() && MailTypeEnum == Mailtype.ComposeMail) //Only for compose mail help text speech work
                    {
                        synth.Speak("The mail sucessfully sent to the recipient");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Mail sent sucessfully", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
                else
                {
                    MessageBox.Show("Unable to sent mail", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }