コード例 #1
0
ファイル: frmRcvrPwd.cs プロジェクト: ayesha159/Domain-Models
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtEmail.Enabled == true)
            {
                Contacts.Service1 sr = new Contacts.Service1();
                lblShow.Text = sr.RecoverPwdE(txtEmail.Text);

                if (lblShow.Text != "invalid user or User no Registered with this email")
                {
                    SendEmailAdmin(txtEmail.Text, lblShow.Text);
                    MessageBox.Show("Password has been sent by Email.");
                }
            }
            else
            {
                Contacts.Service1 sr2 = new Contacts.Service1();
                lblShow.Text = sr2.RecoverPwdS(txtSMS.Text);

                if (txtSMS.Text.Trim().Length == 13)
                {
                    RecPwdbySMS sm = new RecPwdbySMS();
                    sm.SetComPort("com4");
                    sm.Opens();
                    sm.RecoverPwdbySMS(txtSMS.Text, lblShow.Text);
                    sm.Closes();
                    MessageBox.Show("Password has been sent by SMS.");
                }
            }
        }
コード例 #2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            if (comboBox1.Items.Count == 0)
            {
                MessageBox.Show("Add Group Please !"); return;
            }
            Contacts.Service1 sr2 = new Contacts.Service1();
            BindingSource     b   = new BindingSource();

            b.DataSource = sr2.SSTC(myUtill.loginUser.Userid, comboBox1.SelectedValue.ToString());
            foreach (DataGridViewRow gv in gvSMS.Rows)
            {
                string s = gv.Cells[3].Value.ToString();
                {
                    RecPwdbySMS sm = new RecPwdbySMS();
                    sm.SetComPort("com4");
                    sm.Opens();
                    sm.RecoverPwdbySMS(s, textBox1.Text.Trim());
                    sm.Closes();
                }
                System.Threading.Thread.Sleep(10000);
            }

            MessageBox.Show("Your message has been sent");
        }