Exemple #1
0
        public void EmailAndMsg(string email, string no, string nm, List <string> lst)
        {
            Reminder r = new Reminder();

            r.MsgOnly(no, nm, lst);
            r.EmailOnly(email, nm, lst);
            MessageBox.Show("Email sent to " + TxtBxEmail.Text.ToString() + "\nMessage sent to " + TxtBxPhNo.Text.ToString());
        }
Exemple #2
0
 public void EmailAndMsg(string email, string no, string nm, List<string> lst)
 {
     Reminder r = new Reminder();
     r.MsgOnly(no, nm, lst);
     r.EmailOnly(email, nm, lst);
     MessageBox.Show("Email sent to " + TxtBxEmail.Text.ToString() + "\nMessage sent to " + TxtBxPhNo.Text.ToString());
 }
Exemple #3
0
        private void BtnReminder_Click(object sender, EventArgs e)
        {
            Reminder r = new Reminder();

            if (CmBxList.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a mode of reminding you.");
                CmBxList.Focus();
            }
            else if (CmBxList.SelectedIndex == 0)
            {
                if (TxtBxPhNo.Text == null || TxtBxPhNo.Text == "")
                {
                    MessageBox.Show("Please enter your cellphone number to send a message to");
                    TxtBxPhNo.Focus();
                }
                else if (TxtBxPhNo.Text.Length != 10)
                {
                    MessageBox.Show("Invalid Phone number. Please try again");
                    TxtBxPhNo.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                    }
                    else
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 1)
            {
                if (TxtBxEmail.Text == "" || TxtBxEmail.Text == null)
                {
                    MessageBox.Show("Please enter your email id.");
                    TxtBxEmail.Focus();
                }
                else if (!TxtBxEmail.Text.Contains("@") && !TxtBxEmail.Text.Contains("."))
                {
                    MessageBox.Show("Invalid Email id. Please try again.");
                    TxtBxEmail.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, ShpngLst);
                    }
                    else
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 2)
            {
                if (st == 1)
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                }
                else
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, TLst);
                }
            }
        }
Exemple #4
0
        private void BtnReminder_Click(object sender, EventArgs e)
        {
            Reminder r = new Reminder();
            if(CmBxList.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a mode of reminding you.");
                CmBxList.Focus();
            }
            else if(CmBxList.SelectedIndex == 0)
            {
                if (TxtBxPhNo.Text == null || TxtBxPhNo.Text == "")
                {
                    MessageBox.Show("Please enter your cellphone number to send a message to");
                    TxtBxPhNo.Focus();
                }
                else if (TxtBxPhNo.Text.Length != 10)
                {
                    MessageBox.Show("Invalid Phone number. Please try again");
                    TxtBxPhNo.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString() , FName, ShpngLst);
                    }
                    else
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 1)
            {
                if(TxtBxEmail.Text == "" || TxtBxEmail.Text == null)
                {
                    MessageBox.Show("Please enter your email id.");
                    TxtBxEmail.Focus();
                }
                else if(!TxtBxEmail.Text.Contains("@") && !TxtBxEmail.Text.Contains("."))
                {
                    MessageBox.Show("Invalid Email id. Please try again.");
                    TxtBxEmail.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString() , FName, ShpngLst);
                    }
                    else
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 2)
            {
                if (st == 1)
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                }
                else
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, TLst);
                }

            }
        }